<< distfun_lognrnd LogNormal Normal >>

Distribution Functions >> LogNormal > distfun_lognstat

distfun_lognstat

LogNormal mean and variance

Calling Sequence

M = distfun_lognstat ( mu , sigma )
[M,V] = distfun_lognstat ( mu , sigma )

Parameters

mu :

a 1x1 or nxm matrix of doubles, the mean of the underlying normal variable. Should be positive.

sigma :

a 1x1 or nxm matrix of doubles, the standard deviation of the underlying normal variable. Should be positive.

M :

a matrix of doubles, the mean

V :

a matrix of doubles, the variance

Description

Computes statistics from the LogNormal distribution.

The mean and variance of the lognormal distribution are

A lognormal distribution with mean m and variance v has parameters

mu = log(M) - 0.5 * log(1+V./(M.^2))
sigma = sqrt(log(1+V./(M.^2)))

Any scalar input argument is expanded to a matrix of doubles of the same size as the other input arguments.

Examples

mu = 1:6;
sigma = (1:6)^-1;
[M,V] = distfun_lognstat ( mu , sigma )
// See if we can recover the original parameters:
mu = log(M) - 0.5 * log(1+V./(M.^2))
sigma = sqrt(log(1+V./(M.^2)))

Authors

<< distfun_lognrnd LogNormal Normal >>