Lognormal distribution as below:
estimate
meanlog 6.0515
sdlog 0.3703
How to calculate the mean
and sd
of this distribution?
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
exp(6.0515+0.5*(0.3703^2))*sqrt(exp(0.3703^2)-1)=174.4
,different result?
$\endgroup$
Commented
May 29, 2020 at 17:51