Skip to content

log_normal_discrete (one dimensional)

Fabian Kindermann edited this page Apr 2, 2021 · 1 revision
subroutine log_normal_discrete(x, prob, mu, sigma)

Description:

This subroutine calculates the nodes and weights for an approximation of a one-dimensional log-normal distribution with mean and variance . We can use these nodes and weights, for example, to calculate moments as

with

It therefore uses the Gauss-Hermite quadrature method.

Output arguments:

  • real*8 :: x(:)
    A one-dimensional array into which the subroutine stores the nodes for the Gauss-Hermite approximation.
  • real*8 :: prob(:)
    A one-dimensional array into which the subroutine stores the weights or probabilities for the Gauss-Hermite approximation. Note that prob(:) needs to have exactly the same size as x(:).

Optional arguments:

  • real*8 :: mu
    The mean of the log-normally distributed random variable. If not present, the mean is set to a value of . Note that this input variable needs to be positive.
  • real*8 :: sigma
    The variance of the log-normally distributed random variable. If not present, the variance is set to a value of . This input value must be greater than or equal to zero, otherwise the subroutine throws an error message.

References

  • For further reading refer to:
    • Miranda, M. & Fackler, P. (2002). Applied Computational Economics and Finance. Cambridge: MIT Press.
    • Stoer, J. & Bulirsch, R. (2002). Introduction to Numerical Analysis. New York: Springer Text in Applied Mathematics.
    • Press, W.H., Teukolsky, S.A., Vetterling, W.T. & Flannery, B.P. (1992). Numerical Recipes in Fortran 90: The Art of Parallel Scientific Computing, 2nd edition. Cambridge: Cambridge Univeristy Press.
  • This routine is used in the following programs:
    • prog05_02.f90
    • prog05_03.f90
    • prog05_04.f90
    • prog05_05.f90
Clone this wiki locally