Main Content

lognstat

Lognormal mean and variance

Description

example

[m,v] = lognstat(mu,sigma)returns the mean and variance of the lognormal distribution with the distribution parametersmu(mean of logarithmic values) andsigma(standard deviation of logarithmic values).

Examples

collapse all

Compute the mean and variance of the lognormal distribution with parametersmuandsigma.

mu = 0; sigma = 1; [m,v] = lognstat(mu,sigma)
m = 1.6487
v = 4.6708

Input Arguments

collapse all

Mean of logarithmic values for the lognormal distribution, specified as a scalar value or an array of scalar values.

To compute the means and variances of multiple distributions, specify distribution parameters using an array of scalar values. If bothmuandsigmaare arrays, then the array sizes must be the same. If eithermuorsigmais a scalar, thenlognstatexpands the scalar argument into a constant array of the same size as the other argument. Each element inmandvis the mean and variance of the distribution specified by the corresponding elements inmuandsigma.

Example:[0 1 2; 0 1 2]

Data Types:single|double

Standard deviation of logarithmic values for the lognormal distribution, specified as a positive scalar value or an array of positive scalar values.

To compute the means and variances of multiple distributions, specify distribution parameters using an array of scalar values. If bothmuandsigmaare arrays, then the array sizes must be the same. If eithermuorsigmais a scalar, thenlognstatexpands the scalar argument into a constant array of the same size as the other argument. Each element inmandvis the mean and variance of the distribution specified by the corresponding elements inmuandsigma.

Example:[1 1 1; 2 2 2]

Data Types:single|double

Output Arguments

collapse all

Mean of the lognormal distribution, returned as a scalar value or an array of scalar values.mis the same size asmuandsigmaafter any necessary scalar expansion. Each element inmis the mean of the lognormal distribution specified by the corresponding elements inmuandsigma.

Variance of the lognormal distribution, returned as a scalar value or an array of scalar values.vis the same size asmuandsigmaafter any necessary scalar expansion. Each element invis the variance of the lognormal distribution specified by the corresponding elements inmuandsigma.

More About

collapse all

Lognormal Distribution

The lognormal distribution is a probability distribution whose logarithm has a normal distribution.

The meanmand variancevof a lognormal random variable are functions of the lognormal distribution parametersµandσ:

m = exp ( μ + σ 2 / 2 ) v = exp ( 2 μ + σ 2 ) ( exp ( σ 2 ) 1 )

Also, you can compute the lognormal distribution parametersµandσfrom the meanmand variancev:

μ = log ( m 2 / v + m 2 ) σ = log ( v / m 2 + 1 )

Alternative Functionality

  • lognstatis a function specific to lognormal distribution. Statistics and Machine Learning Toolbox™ also offers generic functions to compute summary statistics, including mean (mean), median (median), interquartile range (iqr), variance (var), and standard deviation (std). These generic functions support various probability distributions. To use these functions, create aLognormalDistributionprobability distribution object and pass the object as an input argument.

References

[1] Mood, A. M., F. A. Graybill, and D. C. Boes.Introduction to the Theory of Statistics.3rd ed., New York: McGraw-Hill, 1974. pp. 540–541.

[2] Evans, M., N. Hastings, and B. Peacock.Statistical Distributions. 2nd ed., Hoboken, NJ: John Wiley & Sons, Inc., 1993.

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

Version History

Introduced before R2006a