Page 1 of 1

Mean and SD of lognormal attribute correlated with another attribute

Posted: 17 Jan 2022, 10:07
by Niranjan
Hi all,

If I have two attributes of time: lognormally distributed and correlated as following:

time1 <- -exp(m1 + s1 * draws1)
time2 <- -exp(m2 + s2 * draws2 + s1_2 * draws1)


Now if I want to find the mean and sd for the random variable time2,

is this the correct way of doing that?

Find the unconditionals from the model and find mean and sd as following:

mean = mean(as.vector(unconditionals$time2))
sd = sd(as.vector(unconditionals$time2))

Is this the correct way of finding mean and sd? (Or for narrower distribution using conditionals instead of unconditional)

Re: Mean and SD of lognormal attribute correlated with another attribute

Posted: 17 Jan 2022, 10:58
by stephanehess
Hi

yes, you can use the unconditionals function in that way, or you can also use the analytical formula for the mean and variance of a lognormal - with enough draws, they will converge to each other.

You should never use the conditionals for this purpose

Stephane

Re: Mean and SD of lognormal attribute correlated with another attribute

Posted: 17 Jan 2022, 12:15
by Niranjan
Thank you for the prompt reply,

One more thing
Does the correlation term s1_2 comes somewhere in the analytical formula?

I know generally we use mean= exp(m + s^2/2), but its the correlation parameter s1_2 that’s confusing me.

Re: Mean and SD of lognormal attribute correlated with another attribute

Posted: 18 Jan 2022, 08:08
by stephanehess
Yes, you would need to replace s by sqrt(s2^2+s1_2^2)

Re: Mean and SD of lognormal attribute correlated with another attribute

Posted: 18 Jan 2022, 09:09
by Niranjan
Thank you for clearing that out..