Mollet, Fabian
2007-Mar-23 14:04 UTC
[R] generating lognormal variables with given correlation
Dear R users I use simulated data to evaluate a model by sampling the parameters in my model from lognormal distributions. I would like these (lognormal distributed) parameters to be correlated, that is, I would like to have pairwise samples of 2 parameters with a given correlation coefficient. I have seen that a covariance matrix can be fixed when generating random variables from a multivariate normal distribution e.g. by the function mvrnorm. Is there a function to do the same for a multivariate lognormal distribution? Thank you! Fabian [[alternative HTML version deleted]]
Karl Ove Hufthammer
2007-Mar-23 14:27 UTC
[R] generating lognormal variables with given correlation
Mollet, Fabian:> I would like these (lognormal distributed) parameters to be correlated, > that is, I would like to have pairwise samples of 2 parameters with a > given correlation coefficient. > > I have seen that a covariance matrix can be fixed when generating random > variables from a multivariate normal distribution e.g. by the function > mvrnorm. > > Is there a function to do the same for a multivariate lognormal > distribution?I don't know about any, but you should be aware that not all values of the correlation is possible with lognormal distributions. For example, if both variables have a standard lognormal distribution, they can't have correlation less than 1/e = -0.37. As the variance of the two distributions increase, the absolute value of the maximum and minimum correlation possible decrease (to zero). Using the normal product-moment correlation as a measure of dependence rarely makes much sense unless the association between the variables is linear. -- Karl Ove Hufthammer
Reasonably Related Threads
- Create correlated data with skew
- How to generate a random variate that is correlated with a given right-censored random variate?
- Mean of lognormal in base-2
- better example for multivariate data simulation question-please help if you can
- AIC for lognormal model