Jump to content

Documentation/Calc Functions/LOGNORMDIST

From The Document Foundation Wiki

Function name:

LOGNORMDIST

Category:

Statistical Analysis

Summary:

Calculates log-normal distribution values from either the probability density function or the cumulative distribution function.

A random variable [math]\displaystyle{ x }[/math] is log-normally distributed if [math]\displaystyle{ \text{log}(x) }[/math] is normally distributed. The log-normal distribution is a family of continuous probability distributions that are typically used to model positive, right-skewed data. The distribution has two characteristic parameters, usually denoted as mu (μ) and sigma (σ), that control its location and shape respectively. μ represents the mean value of the underlying normal distribution, while σ represents the standard deviation of the underlying normal distribution.

Syntax:

LOGNORMDIST(Number[; Mean[; STDEV[; Cumulative]]])

Returns:

Returns a non-negative real number, which is the log-normal distribution value for the given arguments. For the probability density function, the value returned lies in the range [0, +∞). For the cumulative distribution function, the value returned lies in the range [0, 1].

Arguments:

Number is a positive real number, or a reference to a cell containing that number, which is the value at which the log-normal distribution is to be evaluated.

Mean is a real number, or a reference to a cell containing that number, which is the value of the location parameter (μ) of the log-normal distribution. If omitted, the default value of 0 is utilized.

STDEV is a positive real number, or a reference to a cell containing that number, which is the value of the shape parameter (σ) of the log-normal distribution. If omitted, the default value of 1 is utilized.

Cumulative is a logical value, or a reference to a cell containing that value, that determines whether the required probability is taken from the probability density function or the cumulative distribution function. If Cumulative is set to 0 or FALSE, a value from the probability density function is calculated. For any other values of Cumulative, or if Cumulative is omitted, a value from the cumulative distribution function is calculated.

  • If any of Number, Mean, or STDEV is non-numeric, then LOGNORMDIST reports a #VALUE! error.
  • If Number is negative or zero, and Cumulative is set to 0 or FALSE (probability density function), then LOGNORMDIST reports an invalid argument error (Err:502).
  • If Number is negative or zero, and Cumulative is not set to either 0 or FALSE (cumulative distribution function), then LOGNORMDIST returns 0.
  • If STDEV is less than or equal to 0.0, then LOGNORMDIST reports an invalid argument error (Err:502).

Additional details:

  • Calc's LOGNORMDIST and LOGNORM.DIST functions perform similar calculations. However, there are minor differences between the two functions with respect to their arguments – for LOGNORM.DIST the Mean, STDEV, and Cumulative arguments cannot be omitted. The requirements for LOGNORMDIST are specified in ODF 1.2; LOGNORM.DIST is provided for interoperability with Microsoft Excel.
  • The formula for the probability density function of the log-normal distribution is given by:
[math]\displaystyle{ \text{LOGNORMDIST}(x; \mu; \sigma; 0)~=~\frac{1}{x\sigma\sqrt{2\pi}}~\text{EXP} \left(-\frac{1}{2}\left( \frac{ln(x)-\mu}{\sigma} \right)^2 \right) }[/math]
where [math]\displaystyle{ x }[/math] is a positive real number.
  • The formula for the cumulative distribution function of the log-normal distribution is given by:
[math]\displaystyle{ \text{LOGNORMDIST}(x; \mu; \sigma; 1)~=~\int_{0}^{x}\frac{1}{t\sigma\sqrt{2\pi}}~ \text{EXP} \left(-\frac{1}{2}\left( \frac{ln(t)-\mu}{\sigma} \right)^2 \right) }[/math]
where again [math]\displaystyle{ x }[/math] is a positive real number.
  • The following figure shows probability density function plots for four sample log-normal distributions.
  • The following figure shows cumulative distribution function plots for four sample log-normal distributions.

Examples:

Formula Description Returns
=LOGNORMDIST(A1; A2; A3; A4) where cells A1:A4 contain the values 1, 0, 1, and 1 respectively. Here the function calculates a value from the cumulative distribution function of the log-normal distribution for the given arguments. 0.5
=LOGNORMDIST(1) Here the function calculates a value from the cumulative distribution function of the log-normal distribution, applying defaults for the omitted arguments. The same value is returned as in the previous example. 0.5
=LOGNORMDIST(7.14; 1.5; 3.2; TRUE()) Here the function calculates a value from the cumulative distribution function of the log-normal distribution for the given arguments. 0.557855853816984
=LOGNORMDIST(7.14; 1.5; 3.2; FALSE()) Here the function calculates a value from the probability density function of the log-normal distribution for the given arguments. 0.0172767714096443
=LOGNORMDIST(-7.14; 1.5; 3.2; 1) For negative and zero values of the Number argument, the function returns zero for the cumulative distribution function. 0

Related LibreOffice functions:

LOGINV

LOGNORM.DIST

LOGNORM.INV

ODF standard:

Section 6.18.44, part 2

Related (or similar) Excel functions:

None