I’m trying to calculate probabilities using a Normal distribution for a vector of values. When I have the same sigma for all values, it is easy, just like this:
sigma = 3
vals = [-1,0,1]
pdf.(Normal(0, sigma), vals)
But what if I have a different sigma value for each value in the vector?
This is what I want:
vals = [-1, 0, 1]
sigma_v = [1 ,2 ,3]
pdf.(Normal(0, sigma_v[1]), vals[1])
pdf.(Normal(0, sigma_v[2]), vals[2])
pdf.(Normal(0, sigma_v[3]), vals[3])
But I can’t get it by doing something like this:
pdf.(Normal(0, sigma_v), vals)
How is this done in Julia?