Table of Contents
- Snippet from Wikipedia: Distribution function
- This article describes the distribution function as used in physics.
Many useful distribution functions can be found in cern.jet.stat.Probability package. The package contains numerical integration of certain probability distributions. Below we will show how to use the normal distribution which is very useful distribution in many statistical analyses.
In the example below we will compute the probability that our random outcome is within a specified interval using the normal distribution.
The code below returns the area under the normal probability density function, integrated from minus infinity to -1.17 (assumes mean is zero, variance is one).
from cern.jet.stat.Probability import * print normal(-1.17)
For the two-sided case, one can multiply the result by 2.
You can find a number of statistical distributions here
Plotting distribution functions
Now let us show how to plot density functions. This is relatively easy if you already read this manual before.
Here is a simply code to plot the Cauchy distribution function:
The image of the Cauchy function generated by this code is shown below: