You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 3, 2019. It is now read-only.
mu <- 1.
sigma <- 1.
for (j in 1:10000) {x[j]~dnLnorm(mu,sigma)}
mean(x)
4.507144
var(x)
36.43327
The mean is exp(mu+sigma^2/2) and the variance is (exp(sigma^2)-1)exp(2mu+sigma^2).
The help on the other hand states the following:
Arguments
mean : The mean in log-space (observed mean is exp(m)).
Type: Real, <any>, const reference
sd : The standard deviation in log-space.
Type: RealPos, <any>, const reference
The text was updated successfully, but these errors were encountered:
Yes mean( ln(X) ) = mu, but the help states that "observed mean is exp(m)”, where as the observed mean is in fact exp(mu+sigma^2/2), this certainly seems inaccurate. I would also call “mean" “mu" and “sd" “sigma", as per the usual parametrisation.
cf.
Arguments
mean : The mean in log-space (observed mean is exp(m)).
Type: Real, <any>, const reference
sd : The standard deviation in log-space.
Type: RealPos, <any>, const reference
On 12 Oct 2018, at 22:43, Fernando Roa ***@***.***> wrote:
I think the help is accurate, try:
for (j in 1:10000) {thelog[j]=ln(x[j])}
mean(thelog)
stdev(thelog)
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
mu <- 1.
sigma <- 1.
for (j in 1:10000) {x[j]~dnLnorm(mu,sigma)}
mean(x)
4.507144
var(x)
36.43327
The mean is exp(mu+sigma^2/2) and the variance is (exp(sigma^2)-1)exp(2mu+sigma^2).
The help on the other hand states the following:
Arguments
The text was updated successfully, but these errors were encountered: