How to find the probability (between 0 and 1) of an observation knowing that follow a Normal dist. and knowing its mean and variance?
11 次查看(过去 30 天)
显示 更早的评论
Hi All,
I know the mean and st. dev. of a Normal distribution and I would like to find the probability (between 0 and 1) of an observation.
I tried p = normpdf(x,mu,sigma)
where x is my observation value and mu and sigma the mean and st. dev. of the Gaussian.
I am getting extremely low values from different observations x.
I believe what I am doing is incorrect, how can I find the probability?
Thank you!
2 个评论
Image Analyst
2020-12-6
If the observation is a single number, wouldn't the probability be zero?
And if you want the probability of an observation being between one number and a different number, wouldn't you use the error function, erf()?
回答(1 个)
John D'Errico
2020-12-7
编辑:John D'Errico
2020-12-7
You misunderstand what a PDF represents. This is a common mistake, suggesting you really want to do some reading about basic probability and statistics.
If you want to compute the probability of any exact event, such as the number 1 coming from a CONTINUOUS distribution, the probability is ZERO. You can compute the probability that a random variable will lie in some interval. But any exact value has measure zero.
As such, we can ask the probability that a standard normal random variable lies in the interval [0.9,1.1]...
diff(normcdf([0.9 1.1]))
So 0.0484. You get that from the CDF, not the PDF. If you wish, you could compute it as an integral of the PDF. Thus,
integral(@(x) normpdf(x),0.9,1.1)
And that is all the CDF gives you.
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!