As an instance of the rv_discrete class, geom object inherits from it
a collection of generic methods (see below for the full list),
and completes them with details specific for this particular distribution.
Methods
rvs(p, loc=0, size=1, random_state=None)
Random variates.
pmf(k, p, loc=0)
Probability mass function.
logpmf(k, p, loc=0)
Log of the probability mass function.
cdf(k, p, loc=0)
Cumulative distribution function.
logcdf(k, p, loc=0)
Log of the cumulative distribution function.
sf(k, p, loc=0)
Survival function (also defined as 1-cdf, but sf is sometimes more accurate).
logsf(k, p, loc=0)
Log of the survival function.
ppf(q, p, loc=0)
Percent point function (inverse of cdf — percentiles).
geom takes \(p\) as shape parameter,
where \(p\) is the probability of a single success
and \(1-p\) is the probability of a single failure.
Note that when drawing random samples, the probability of observations that exceed
np.iinfo(np.int64).max increases rapidly as $p$ decreases below 10ドル^{-17}$. For
$p < 10^{-20},ドル almost all observations would exceed the maximum int64; however,
the output dtype is always int64, so these values are clipped to the maximum.
The probability mass function above is defined in the "standardized" form.
To shift distribution use the loc parameter.
Specifically, geom.pmf(k,p,loc) is identically
equivalent to geom.pmf(k-loc,p).
Alternatively, the distribution object can be called (as a function)
to fix the shape and location. This returns a "frozen" RV object holding
the given parameters fixed.
Freeze the distribution and display the frozen pmf: