Displaying 1 result from an estimated 1 matches for "sigma2h".
Did you mean:
sigma2
2011 Jul 20
1
Fwd: Help please
...sigma squared (sigma2). I understood this
should simply be:
exp(mu + sigma2)
... but I the following code gives me something strange:
R <- 10000000
mu <- -400
sigma2 <- 200
tmp <- rlnorm(R, mu, sqrt(sigma2)) # a sample from the desired log-normal
distribution
muh <- mean(log(tmp))
sigma2h <- var(log(tmp))
#by my understanding, all of the the following vectors should then contain
very similar numbers
c(mu, muh)
c(sigma2, sigma2h)
c(exp(mu + sigma2/2), exp(muh + sigma2h/2), mean(tmp))
I get the following (for one sample):
> c(mu, muh)
[1] -400.0000 -400.0231
> c(sigma2, si...