Reputation: 185
I am using the boost::math::pdf to calculate a probability from a normal distribution. I give a variable which corresponds to distance to the mean and boost::math::pdf gives me a porbability in return.
It works, but i really dont get how because in a continuous distribution (and a normal distribution is a continuous distribution ) you need to integrate between two values to get a probability.
If the distribution is discrete then, a point really does corresponds to a probability but from everything i've read i got the impression that i deal with a continuous distribution.
I would really appriciate it if anyone can shed light upon the topic. How do you get the the probability of just one value with boost::math::pdf ?
PS: Since computer work in a discrete way, i though maybe the normal distribution i am using is discrete after all but that doesnt make sense tbh.
Upvotes: 2
Views: 1289
Reputation: 3156
PDF stands for Probability Density Function, which is just a specialized function whose area under the curve from -infinity to +infinity equals 1 (for continuous probability distributions).
You are giving it the X value, and it is returning the resulting Y value. Your interpretation of that value is not correct - it is NOT the probability of the result equaling EXACTLY that X value (you are correct in that probability is weakly zero).
I recommend you read up about PDF (see the link above) so you understand the library function.
Upvotes: 0