bundles / scipy latest / scipy / stats / _probability_distribution / _ProbabilityDistribution / pmf
function
scipy.stats._probability_distribution:_ProbabilityDistribution.pmf
Signature
def pmf ( self , x , / , method = None ) Summary
Probability mass function
Extended Summary
The probability mass function ("PMF"), denoted , is the probability that the random variable will assume the value .
pmf accepts x for .
Parameters
x: array_likeThe 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
methodoptions are available for all distributions. If the selectedmethodis not available, aNotImplementedErrorwill be raised.
Returns
out: arrayThe 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 returns 0 at all real arguments.
Examples
Instantiate a distribution with the desired parameters:from scipy import stats X = stats.Binomial(n=10, p=0.5)✓
X.pmf(5)
✗See also
Aliases
-
scipy.stats._distribution_infrastructure._ProbabilityDistribution.pmf