getLognormMoments {lognorm}R Documentation

Compute summary statistics of a log-normal distribution

Description

Compute summary statistics of a log-normal distribution

Usage

getLognormMoments(mu, sigma, m = exp(mu + sigma2/2) - shift, shift = 0)

getLognormMedian(mu, sigma, shift = 0)

getLognormMode(mu, sigma, shift = 0)

Arguments

mu

numeric vector: location parameter

sigma

numeric vector: scale parameter

m

mean at original scale, may override default based on mu

shift

shift for the shifted lognormal distribution

Value

for getLognormMoments a numeric matrix with columns mean (expected value at original scale) , var (variance at original scale) , and cv (coefficient of variation: sqrt(var)/mean). For the other functions a numeric vector of the required summary.

Functions

References

Limpert E, Stahel W & Abbt M (2001) Log-normal Distributions across the Sciences: Keys and Clues. Oxford University Press (OUP) 51, 341, 10.1641/0006-3568(2001)051[0341:lndats]2.0.co;2

See Also

scaleLogToOrig

Examples

  # start by estimating lognormal parameters from moments
  .mean <- 1
  .var <- c(1.3,2)^2
  parms <- getParmsLognormForMoments(.mean, .var)
  #
  # computed moments must equal previous ones
  (ans <- getLognormMoments(parms[,"mu"], parms[,"sigma"]))
  cbind(.var, ans[,"var"])
  #
  getLognormMedian(mu = log(1), sigma = log(2))
  getLognormMode(mu = log(1), sigma = c(log(1.2),log(2)))


[Package lognorm version 0.1.10 Index]