exp_dist_log

mdtools.statistics.exp_dist_log(x, rate)[source]

Logarithm of the exponential distribution.

\[f(x) = \ln(\lambda) - \lambda x\]
Parameters:
  • x (scalar or array_like) – Array of \(x\) values for which to evaluate \(f(x)\).

  • rate (scalar or array_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 or array_like) – The function values \(f(x)\) at the given \(x\) values.

See also

exp_dist()

Exponential distribution

Examples

>>> x = np.linspace(0, 4, 5)
>>> y1 = mdt.stats.exp_dist_log(x, rate=2)
>>> y2 = mdt.stats.exp_dist(x, rate=2)
>>> np.allclose(y1, np.log(y2), rtol=0)
True
>>> y1
array([ 0.69314718, -1.30685282, -3.30685282, -5.30685282, -7.30685282])