bundles / scipy 1.17.1 / scipy / stats / _probability_distribution / _ProbabilityDistribution / pdf
function
scipy.stats._probability_distribution:_ProbabilityDistribution.pdf
Signature
def pdf ( self , x , / , method ) Summary
Probability density function
Extended Summary
The probability density function ("PDF"), denoted , is the probability per unit length that the random variable will assume the value . Mathematically, it can be defined as the derivative of the cumulative distribution function :
pdf accepts x for .
Parameters
x: array_likeThe argument of the PDF.
method: {None, 'formula', 'logexp'}The strategy used to evaluate the PDF. By default (
None), the infrastructure chooses between the following options, listed in order of precedence.'formula': use a formula for the PDF itself'logexp': evaluate the log-PDF and exponentiate
Not all
methodoptions are available for all distributions. If the selectedmethodis not available, aNotImplementedErrorwill be raised.
Returns
out: arrayThe PDF evaluated at the argument
x.
Notes
Suppose a continuous probability distribution has support . By definition of the support, the PDF evaluates to its minimum value of outside the support; i.e. for or . The maximum of the PDF may be less than or greater than ; since the value is a probability density, only its integral over the support must equal .
For discrete distributions, pdf returns inf at supported points and 0 elsewhere.
Examples
Instantiate a distribution with the desired parameters:from scipy import stats X = stats.Uniform(a=-1., b=1.)✓
X.pdf(0.25)
✗See also
Aliases
-
scipy.stats._distribution_infrastructure._ProbabilityDistribution.pdf