How do I calculate PDF (probability density function) in Python?

前端 未结 3 1093
故里飘歌
故里飘歌 2021-02-06 05:07

I have the following code below that prints the PDF graph for a particular mean and standard deviation.

http://imgur.com/a/oVgML

Now I need to find the actual pr

3条回答
  •  你的背包
    2021-02-06 05:40

    The area under a curve y = f(x) from x = a to x = b is the same as the integral of f(x)dx from x = a to x = b. Scipy has a quick easy way to do integrals. And just so you understand, the probability of finding a single point in that area cannot be one because the idea is that the total area under the curve is one (unless MAYBE it's a delta function). So you should get 0 ≤ probability of value < 1 for any particular value of interest. There may be different ways of doing it, but a conventional way is to assign confidence intervals along the x-axis like this. I would read up on Gaussian curves and normalization before continuing to code it.

提交回复
热议问题