I want to generate an artificial population using two variables (say x & y) with a fixed correlation between x & y. Which package/command in R software can help in this?
More generally, a multivariate normal variable X with k dimensions, and covariance matrix Σ = LLT, can be generated by starting with a vector Y of k independent normal variables with variance 1, and using the following theorem.
Theorem. If Σ = LLT, then the covariance matrix of X = LY is Σ.
For random variables with beta or gamma distribution, I propose an algorithm (see attached file), based on a work of Michael & Schucany (The mixture approach for simulating bivariate distributions with specified correlations, The American Statistician, 56 (1), 48-54). Instead of R programming, you can also test the following MATLAB® codes.
, I think we can use commands like #rmvpois instead of #rmvnorm for poisson distribution and similarly for other distributions. I have to check if it works or not.