Here's a problem that I'd like to solve to help me with some Monte Carlo modeling. Suppose I have n random variables Xi (indexed by i, i = 1, ..., n). The distributions for each of these random variables is arbitrary; however, practically, I'll be using numpy and python, so I'll use the discrete and continuous distributions that numpy supports.
Now, suppose I also have an n x n correlation matrix R for these random variables; this is a matrix with all 1's on the diagonal, is symmetric, and each off-diagonal element is less than or equal to 1 in absolute value. I want to generate m random vectors with components Xi such that the random samples in each dimension have the requisite covariances implied by the correlation matrix.
Do any of you folks know how to do this? A reference to the literature on how to do it is fine too. An ideal answer would work within the constraints of python/numpy.
Now, suppose I also have an n x n correlation matrix R for these random variables; this is a matrix with all 1's on the diagonal, is symmetric, and each off-diagonal element is less than or equal to 1 in absolute value. I want to generate m random vectors with components Xi such that the random samples in each dimension have the requisite covariances implied by the correlation matrix.
Do any of you folks know how to do this? A reference to the literature on how to do it is fine too. An ideal answer would work within the constraints of python/numpy.