3

Surprisingly, I can't find a discussion on calculating confidence intervals for the mean $EY=e^{\mu+\sigma^2/2}$ of the lognormal distribution. My question goes beyond what is covered in the link below, and is specific to the package EnvStats.

Confidence Interval for Mu in a Log normal Distributions in R

Say I have some lognormal data:

mydat <- data.frame(value = rlnorm(1000, meanlog = 6, sdlog = .5))

That looks like: enter image description here

I use EnvStats::elnormAlt to estimate parameters for the lognormal distribution mydat.

elnormAlt(mydat$value, method = "mvue", ci = FALSE, ci.type = "two-sided", 
  ci.method = "land", conf.level = 0.95)

And obtain:

Results of Distribution Parameter Estimation
--------------------------------------------

Assumed Distribution:            Lognormal

Estimated Parameter(s):          mean = 454.7097844
                                 cv   =   0.5359667

Estimation Method:               mvue

Data:                            mydat$value

Sample Size:                     1000

When I change the argument ci = TRUE, I get the error:

Error in integrate(density.fcn.qlands.t, -pi/2, theta, nu = nu, zeta = zeta) : 
  non-finite function value

My questions are twofold:

  1. Can someone succinctly explain the mathematical meaning of cv?
  2. What is the meaning of the error message I'm getting, and how can I calculate confidence intervals using the Land (Cox) method?
kjetil b halvorsen
  • 63,378
  • 26
  • 142
  • 467
Rich Pauloo
  • 139
  • 5
  • https://www.rdocumentation.org/packages/EnvStats/versions/2.1.0/topics/LognormalAlt – Roland Aug 22 '17 at 07:21
  • 1
    Maybe try a different `ci.method`? I don't know which function is integrated (the documentation is rather long and I don't have time to study it in detail), but apparently non-finite values occur. – Roland Aug 22 '17 at 07:24
  • 3
    If $Y=e^X$ and $X\sim N(\mu,\sigma^2)$, then $Y$ is lognormal with parameters $\mu$ and $\sigma^2$. Do you want a confidence interval for $\mu=E(\ln Y)$ or a confidence interval for the mean of $Y$, $EY = e^{\mu + \sigma^2/2}$? Or perhaps something else? – Jarle Tufto Aug 22 '17 at 08:20
  • 1
    "cv" is *coefficient of variation* which is standard deviation divided by mean. For the lognormal this is a monotonic-increasing function of $\sigma$. – Glen_b Aug 22 '17 at 08:27
  • 1
    Second question: problem with `EnvStats:::ci.land()`. For some reason it can't handle more than approx. 260 values, and right now I'm not in the mood to dig deeper into code. For vector less than 260 elements `ci.land()` gives pretty much the same values as `ci.lnorm.zou()` and pretty close to bootstrap estimate. – Andrey Kolyadin Aug 22 '17 at 08:37
  • 2
    @Andrey Ultimately such tables rely on numerical approximations or simulation results going back to the 1970's. The most popular were republished in Gilbert's book (*Statistical Methods for Environmental Pollution Monitoring*), which went only to $n=101$. See https://stats.stackexchange.com/questions/108909. I found a copy of Land's original (1971) paper with the underlying theory: https://projecteuclid.org/download/pdf_1/euclid.aoms/1177693235. It gives us some very good guesses concerning the nature of the error message quoted here. – whuber Aug 22 '17 at 17:56
  • Thank you for the suggestions everyone. All of these comments are very helpful. Upon further reflection, what I really need is a **way to express uncertainty in my estimate of the mean of some data that follows a lognormal distribution**. It occurs to me now that the confidence interval is not the best way to express this, but rather, the standard deviation, which can be used along with the mean and some values to approximate the lognormal distribution. So according to @Glen_b's definition of `cv`, I should be able to calculate standard deviation as _σ_ = _cv_ * _μ_. Thoughts? – Rich Pauloo Aug 22 '17 at 19:47
  • 1
    Beware; traditionally with the lognormal $\mu$ and $\sigma$ don't represent the population mean and standard deviation of the lognormal variate but of its logarithm. The mean of the lognormal is then $e^{\mu+\frac12\sigma^2}$ and the standard deviation is $e^{\mu+\frac12\sigma^2}\sqrt{e^{\sigma^2}-1}$, where $\sqrt{e^{\sigma^2}-1}$ is the coefficient of variation. See Wikipedia [Log-normal distribution](https://en.wikipedia.org/wiki/Log-normal_distribution) – Glen_b Aug 22 '17 at 23:17
  • See also https://stats.stackexchange.com/questions/33382/how-do-i-calculate-a-confidence-interval-for-the-mean-of-a-log-normal-data-set – kjetil b halvorsen Feb 01 '19 at 12:22

0 Answers0