Converts mean and variance of normal distribution to the parameters for a log-normal
distribution with the same mean and variance
Arguments
- m
Mean of the normal distribution
- v
Variance of the normal distribution
Value
A vector of length two. The first element is the mean and the second element is the variance
of the log-normal distribution
Examples
norm <- rnorm(1000, mean=5, sd=2)
params <- norm2lnorm(5, 2^2)
lnorm <- rlnorm(1000, meanlog=params[1], sdlog=params[2]^0.5)
# Mean and SD of lnorm is equivalent to mean and sd of norm
mean(lnorm)
#> [1] 4.970504
sd(lnorm)
#> [1] 1.927719