pmf#
- Normal.pmf(x, /, *, method=None)[source]#
Probability mass function
The probability mass function (“PMF”), denoted , is the probability that the random variable will assume the value .
pmf
accepts x for .- Parameters:
- xarray_like
The argument of the PMF.
- method{None, ‘formula’, ‘logexp’}
The strategy used to evaluate the PMF. By default (
None
), the infrastructure chooses between the following options, listed in order of precedence.'formula'
: use a formula for the PMF itself'logexp'
: evaluate the log-PMF and exponentiate
Not all method options are available for all distributions. If the selected method is not available, a
NotImplementedError
will be raised.
- Returns:
- outarray
The PMF evaluated at the argument x.
Notes
Suppose a discrete probability distribution has support over the integers . By definition of the support, the PMF evaluates to its minimum value of for non-integral and for outside the support; i.e. for or .
For continuous distributions,
pmf
returns0
at all real arguments.References
[1]Probability mass function, Wikipedia, https://en.wikipedia.org/wiki/Probability_mass_function
Examples
Instantiate a distribution with the desired parameters:
>>> from scipy import stats >>> X = stats.Binomial(n=10, p=0.5)
Evaluate the PMF at the desired argument:
>>> X.pmf(5) np.float64(0.24609375)