Learn R Programming

lognorm (version 0.1.6)

getLognormMoments: getLognormMoments

Description

get the expected value and variance of a log-normal distribution

Usage

getLognormMoments(mu, sigma)

Arguments

mu

numeric vector of center parameter (mean at log scale, log(median))

sigma

numeric vector of scale parameter (standard deviation at log scale)

Value

numeric matrix with columns

mean

expected value at original scale

var

variance at original scale

cv

coefficient of variation: std/mean

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

Examples

Run this code
# NOT RUN {
# 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"])
# }

Run the code above in your browser using DataLab