exp_dist
- mdtools.statistics.exp_dist(x, rate=1)[source]
Exponential distribution.
\[f(x) = \lambda e^{-\lambda x}\]The mean and standard deviation of an exponential distribution are given by \(1/\lambda\).
- Parameters:
x (
scalar
orarray_like
) – Array of \(x\) values for which to evaluate \(f(x)\).rate (
scalar
orarray_like
, optional) – The value(s) for \(\lambda\). If an array is provided, it must be broadcastable to a common shape with x.
- Returns:
f (
scalar
orarray_like
) – The function values \(f(x)\) at the given \(x\) values.
See also
scipy.stats.expon
Exponential continuous random variable
Examples
>>> from scipy.stats import expon >>> x = np.linspace(0, 4, 5) >>> y1 = mdt.stats.exp_dist(x, rate=2) >>> y2 = expon.pdf(x, loc=0, scale=1/2) >>> np.allclose(y1, y2, rtol=0) True >>> y1 array([2.00000000e+00, 2.70670566e-01, 3.66312778e-02, 4.95750435e-03, 6.70925256e-04])