3
$\begingroup$

Lognormal distribution as below:

        estimate 
meanlog   6.0515   
sdlog     0.3703   

How to calculate the mean and sd of this distribution?

$\endgroup$
0

1 Answer 1

4
$\begingroup$

Let $X$ be lognormally distributed. Denote $\mu$ and $\sigma$ as the mean and standard deviation of $\log(X)$. The mean and standard deviation of $X$ are given by: \begin{align} \mathrm{E}(X)&=e^{\mu + \frac{1}{2}\sigma^{2}} \\ \mathrm{SD}(X) &= e^{\mu + \frac{1}{2}\sigma^{2}}\sqrt{e^{\sigma^{2}}-1} \end{align}

In your case, that means: \begin{align} \hat{x} &= 454.89\\ \hat{\sigma} &= 174.39 \end{align}

Here is a custom R function that implements these formulas:

logno_moments <- function(meanlog, sdlog) {
  m <- exp(meanlog + (1/2)*sdlog^2)
  s <- exp(meanlog + (1/2)*sdlog^2)*sqrt(exp(sdlog^2) - 1)
  return(list(mean = m, sd = s))
}

It returns a list with the transformed mean and standard deviation:

meanlog <- 6.0515
sdlog <- 0.3703

logno_moments(meanlog, sdlog)

$mean
[1] 454.8925

$sd
[1] 174.3895
$\endgroup$
3
  • $\begingroup$ Is there any R function can be used?I cannot remember formula of each distribution? $\endgroup$
    – kittygirl
    Commented May 29, 2020 at 17:39
  • $\begingroup$ exp(6.0515+0.5*(0.3703^2))*sqrt(exp(0.3703^2)-1)=174.4,different result? $\endgroup$
    – kittygirl
    Commented May 29, 2020 at 17:51
  • $\begingroup$ @kittygirl Yes, the numbers were off, thanks. I have corrected the values and added a custom R function that does the calculations automatically. $\endgroup$ Commented May 29, 2020 at 17:56

Not the answer you're looking for? Browse other questions tagged or ask your own question.