Skip to content
Prev 17712 / 398502 Next

Random data with correlation

On Fri, 8 Mar 2002, Edwin Velds wrote:

            
Once upon a time people used to look up authoritative sources, things
called `monographs', to find the best available methods.  It's still a good
idea.
(Strange notation: L is used for the lower-triangle of the Choleski
decomposition as used by Choleski.)
Only non-negative definite.  With 33 samples you will only get
a rank-32 covariance matrix.
Theoretically so too.
The determinant is 0.
Use mvrnorm in package MASS.  As you will see from its comments, it
avoids chol for precisely this sort of reason, and it has a tolerance
for producing a rank-deficient sample.