Truncated discrete exponential distribution¶
The distribution trunc_discrete_exp is equivalent to SciPy’s boltzmann distribution.
The parameters are lam > 0 (real parameter) and n > 0 (integer parameter).
The support is {0, 1, 2, …, n - 1}.
The probability mass function is p(k) = C*exp(-lam*k), where C is a normalization constant.
The distribution is uniform if lam == 0.
- mpsci.distributions.trunc_discrete_exp.cdf(k, lam, n)¶
Cumulative distribution function of the truncated discrete exponential distribution.
- mpsci.distributions.trunc_discrete_exp.logpmf(k, lam, n)¶
Logarithm of PMF of the truncated discrete exponential distribution.
- mpsci.distributions.trunc_discrete_exp.mean(lam, n)¶
Mean of the truncated discrete exponential distribution.
- mpsci.distributions.trunc_discrete_exp.pmf(k, lam, n)¶
Probability mass function of the truncated discrete exponential distribution.
- mpsci.distributions.trunc_discrete_exp.sf(k, lam, n)¶
Survival function of the truncated discrete exponential distribution.
- mpsci.distributions.trunc_discrete_exp.support(lam, n)¶
Support of the truncated discrete exponential distribution.
The support is the integers 0, 1, 2, …, n - 1; this is implemented by returning range(n). That is, the return value is the range instance, not a sequence.
Examples
>>> from mpsci.distributions import trunc_discrete_exp >>> sup = trunc_discrete_exp.support(2.5, 6) >>> [k for k in sup] [0, 1, 2, 3, 4, 5]
- mpsci.distributions.trunc_discrete_exp.var(lam, n)¶
Variance of the truncated discrete exponential distribution.