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.
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
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()?
Gabriele Galli
Gabriele Galli 2020-12-6
Thank you for the reply.
Yes, what you are saying makes perfectly sense.
I will try to explain better my issue, any help is really appreaciated!
I am trying to model the forward algorithm for hidden markov chain and the so called observation matrix B is continuous, for this reason it is described by a 2 by N matrix (N=number of hidden states) and 2 is related to mean and variance of a Normal distribution (the observation probability of each hidden state is assumed Normal).
In the screen shot attached there is the formula that is giving me the issue. I have to multiply the bracket term by b_j(O_t) which the observation matrix B term (mean and variance) of the j-th hidden state w.r.t. the observation O at time t (so it is a single observation).
I tried to model this using normpdf function where x is the observation at time t and mu and sigma are related to the state j. Doing so, I am obtained number that are really small (e-58) which I assumed they are not correct. Do you have any idea on how I can model this element b_j(O_t) of the matrix B?
Thank you so much!

请先登录,再进行评论。

回答(1 个)

John D'Errico
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]))
ans = 0.0484
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)
ans = 0.0484
And that is all the CDF gives you.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by