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 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)={1xs2πexp((logxm)22s2)for x00for x<0
Categories: Package distrib ·
Function: cdf_lognormal (x,m,s)

Returns the value at x of the distribution function of a 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)={12[1+erf(logxms2)]for x>00for x0
(%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 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 Lognormal(m,s) random variable, with s>0. To make use of this function, write first load("distrib").

The mean is

E[X]=exp(m+s22)
Categories: Package distrib ·
Function: var_lognormal (m,s)

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

The variance is

V[X]=(exp(s2)1)exp(2m+s2)
Categories: Package distrib ·
Function: std_lognormal (m,s)

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

The standard deviation is

D[X]=(exp(s2)1)exp(m+s22)
Categories: Package distrib ·
Function: skewness_lognormal (m,s)

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

The skewness coefficient is

SK[X]=(exp(s2)+2)exp(s2)1
Categories: Package distrib ·
Function: kurtosis_lognormal (m,s)

Returns the kurtosis coefficient of a 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(4s2)+2exp(3s2)+3exp(2s2)3
Categories: Package distrib ·
Function: random_lognormal (m,s)
    random_lognormal (m,s,n)

Returns a 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