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
However, the scipy documentation indicates that a lognormal distribution can be configured with lognorm, using scale and shape s, with scale = exp(mu) and s = sigma with mu and sigma being the mean and standard deviation of the corresponding normal distribution. This means that mu = param.default and sigma = param.std for a lognormal-distributed parameter.
BUT apparently scale takes the median (exp(mu)) and not the mean, so you should not pass np.exp(param.default) but rather the following:
It is confusing, because using the log-transformed mean and the non-transformed standard deviation is inconsistent, but it seems to yield the right results.
The text was updated successfully, but these errors were encountered:
Hi, we have been struggling with @alvarojhahn about how the lognormal distribution is defined.
The lognormal sampling for a given parameter is done at the following line of code:
lca_algebraic/lca_algebraic/params.py
Line 274 in 46144bf
However, the
scipy
documentation indicates that a lognormal distribution can be configured withlognorm
, using scale and shape s, withscale = exp(mu)
ands = sigma
withmu
andsigma
being the mean and standard deviation of the corresponding normal distribution. This means thatmu = param.default
andsigma = param.std
for a lognormal-distributed parameter.BUT apparently
scale
takes the median (exp(mu)
) and not the mean, so you should not passnp.exp(param.default)
but rather the following:It is confusing, because using the log-transformed mean and the non-transformed standard deviation is inconsistent, but it seems to yield the right results.
The text was updated successfully, but these errors were encountered: