Next: , Previous: , Up: Functions and Variables for continuous distributions   [Contents][Index]

52.2.8 Lognormal Random Variable

The lognormal distribution is distribution for a random variable whose logarithm is normally distributed.

Function: pdf_lognormal (x,m,s)

Returns the value at x of the density function of a \({\it Lognormal}(m,s)\) random variable, with \(s>0\). To make use of this function, write first load("distrib").

The pdf is

\[f(x; m, s) = \cases{ \displaystyle{1\over x s \sqrt{2\pi}} \exp\left(-\displaystyle{\left(\log x - m\right)^2\over 2s^2}\right) & for $x \ge 0$ \cr \cr 0 & for $x < 0$ } \]
Categories: Package distrib ·
Function: cdf_lognormal (x,m,s)

Returns the value at x of the distribution function of a \({\it Lognormal}(m,s)\) random variable, with \(s>0\). This function is defined in terms of Maxima’s built-in error function erf.

The cdf is

\[F(x; m, s) = \cases{ \displaystyle{1\over 2}\left[1+{\rm erf}\left({\log x - m\over s\sqrt{2}}\right)\right] & for $x > 0$ \cr \cr 0 & for $x \le 0$ } \]
(%i1) load ("distrib")$
(%i2) cdf_lognormal(x,m,s);
                                 log(x) - m
                             erf(----------)
                                 sqrt(2) s     1
(%o2)          unit_step(x) (--------------- + -)
                                    2          2

See also erf.

Categories: Package distrib ·
Function: quantile_lognormal (q,m,s)

Returns the q-quantile of a \({\it Lognormal}(m,s)\) random variable, with \(s>0\); in other words, this is the inverse of cdf_lognormal. Argument q must be an element of \([0,1]\). To make use of this function, write first load("distrib").

(%i1) load ("distrib")$
(%i2) quantile_lognormal(95/100,0,1);
                     sqrt(2) inverse_erf(9/10)
(%o2)              %e
(%i3) float(%);
(%o3)                   5.180251602233015
Categories: Package distrib ·
Function: mean_lognormal (m,s)

Returns the mean of a \({\it Lognormal}(m,s)\) random variable, with \(s>0\). To make use of this function, write first load("distrib").

The mean is

\[E[X] = \exp\left(m+{s^2\over 2}\right) \]
Categories: Package distrib ·
Function: var_lognormal (m,s)

Returns the variance of a \({\it Lognormal}(m,s)\) random variable, with \(s>0\). To make use of this function, write first load("distrib").

The variance is

\[V[X] = \left(\exp\left(s^2\right) - 1\right) \exp\left(2m+s^2\right) \]
Categories: Package distrib ·
Function: std_lognormal (m,s)

Returns the standard deviation of a \({\it Lognormal}(m,s)\) random variable, with \(s>0\). To make use of this function, write first load("distrib").

The standard deviation is

\[D[X] = \sqrt{\left(\exp\left(s^2\right) - 1\right)} \exp\left(m+{s^2\over 2}\right) \]
Categories: Package distrib ·
Function: skewness_lognormal (m,s)

Returns the skewness coefficient of a \({\it Lognormal}(m,s)\) random variable, with \(s>0\). To make use of this function, write first load("distrib").

The skewness coefficient is

\[SK[X] = \left(\exp\left(s^2\right)+2\right)\sqrt{\exp\left(s^2\right)-1} \]
Categories: Package distrib ·
Function: kurtosis_lognormal (m,s)

Returns the kurtosis coefficient of a \({\it Lognormal}(m,s)\) random variable, with \(s>0\). To make use of this function, write first load("distrib").

The kurtosis coefficient is

\[KU[X] = \exp\left(4s^2\right)+2\exp\left(3s^2\right)+3\exp\left(2s^2\right)-3 \]
Categories: Package distrib ·
Function: random_lognormal (m,s)
    random_lognormal (m,s,n)

Returns a \({\it Lognormal}(m,s)\) random variate, with \(s>0\). Calling random_lognormal with a third argument n, a random sample of size n will be simulated.

Log-normal variates are simulated by means of random normal variates. See random_normal for details.

To make use of this function, write first load("distrib").


Next: , Previous: , Up: Functions and Variables for continuous distributions   [Contents][Index]

JavaScript license information