Skip to content

log_normalPDF

Fabian Kindermann edited this page Apr 1, 2021 · 10 revisions
function log_normalPDF(x, mu, sigma)

Description:

Calculates the probability density function
$$
f(x) = frac{1}{sqrt{2pitildesigma^2}x} cdot expleft[-frac{1}{2}cdot left(frac{log(x)-tilde mu}{tildesigma}right)^2right]
$$
of the log-normal distribution with mean (mu) and variance (sigma^2) using
$$
tilde sigma^2 = logleft(1 + frac{sigma^2}{mu^2}right) quad text{and} quad tilde mu = log(mu) – frac{tilde sigma^2}{2}.
$$

Input arguments:

  • real*8 :: x
    The point where to evaluate the probability density function of the log-normal distribution.

Optional arguments:

  • real*8 :: mu
    The mean of the distribution. If not present, the function uses (mu = e^{0.5}). Note that this input variable needs to be strictly greater than zero.
  • real*8 :: sigma
    The variance (sigma^2) of the distribution. If not present, the function uses (sigma^2 = ecdot (e-1)). Note that this input variable needs to be strictly greater than zero.

Return Value:

  • real*8 :: log_normalPDF
    The value of the density at x.

References

  • For further reading refer to:
    • Toral, R. & Colet, P. (2014). Stochastic Numerical Methods: An Introduction for Students and Scientists. Weinheim: Wiley.
  • This routine is used in the following programs:
    • prog02_15.f90
Clone this wiki locally