2

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.

Firat.Berk.Cakar
  • 185
  • 1
  • 12
  • A pdf doesn't return a probability -- instead it returns probability density, i.e. probability per unit measure. In order to get a probability, you are correct, you must integrate between two points. But to a good approximation, the integral from a to b is approximately (b - a) times pdf(x) when b - a is small and a <= x <= b. I can see why you're confused, people are often not careful about distinguishing probabilities from probability densities. – Robert Dodier Apr 21 '17 at 19:48

1 Answers1

0

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.

franji1
  • 3,088
  • 2
  • 23
  • 43