Calculating probability in normal distribution

I want to calculate the probability of any particular value in a normal distribution. I suppose this is equivalent to calculating the percentile of a data point. Ideally some sort of function where I input a value and a mean and std and it outputs the percentage. Like looking at a z-score table…
Thank you.

1 Like

Something like this?

using Distributions
dist = Normal(3, 1)
cdf(dist, 1)
3 Likes

That is exactly it. Thank you very much.

Note that this is the probability of obtaining a value less than or equal to 1. The probability of obtaining a particular value is 0. :wink:

3 Likes

Right. And if you wanted the relative likelihood, you could use pdf(dist, 1)

I know enough math/stats to know that, but thank you. Just implementing it via Julia, I was lost. Thanks again.

1 Like

I’m not sure that the term relative likelihood is the best for pdf(dist,1) since it returns the probability density for the value x=1 and not necessarily the likelihood. I guess for it to be called a likelihood the data should be fixed and the pdf is evaluated as a function of the parameter(s) in the distribution, i.e. over \mu or \sigma in the case we use a Normal distribution. For example, the likelihood given a known \sigma=1 and observed data x=1 would be something like likelihood(mu) = pdf(Normal(mu,1),1) or likelihood(sigma) = pdf(Normal(2,sigma),1) for known \mu=2 and x=1, or treating both parameters unknown.

3 Likes