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!