Re: [R] Generate multivariate normal data with a random correlation matrix

2011-02-10 Thread rex.dwyer
011 11:30 AM To: r-help@r-project.org Cc: Rick DeShon Subject: Re: [R] Generate multivariate normal data with a random correlation matrix The knee jerk thought I had was to express the correlation matrix as a generic Choleski decomposition, then randomly populate the triangular decomposed ma

Re: [R] Generate multivariate normal data with a random correlation matrix

2011-02-10 Thread Rick DeShon
011 11:30 AM > To: r-help@r-project.org > Cc: Rick DeShon > Subject: Re: [R] Generate multivariate normal data with a random correlation > matrix > > The knee jerk thought I had was to express the correlation matrix as a > generic Choleski decomposition, then randomly populat

Re: [R] Generate multivariate normal data with a random correlation matrix

2011-02-09 Thread Szumiloski, John
om: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Rick DeShon Sent: Wednesday, 09 February, 2011 11:06 AM To: r-h...@stat.math.ethz.ch Subject: [R] Generate multivariate normal data with a random correlation matrix Hi All. I'd like to generate a s

Re: [R] Generate multivariate normal data with a random correlation matrix

2011-02-09 Thread Eik Vettorazzi
Hi Rick, you can generate an arbitrary matrix X and calculate X'X, which is at least positive semi-definite (and definite, when X has full rank) X<-matrix(rnorm(16),4) covmat<-t(X)%*%X #check !any(eigen(covmat)$value<0) #corresponding correlation matrix cov2cor(covmat) Random multivariate can b

[R] Generate multivariate normal data with a random correlation matrix

2011-02-09 Thread Rick DeShon
Hi All. I'd like to generate a sample of n observations from a k dimensional multivariate normal distribution with a random correlation matrix. My solution: 1) The lower (or upper) triangle of the correlation matrix has n.tri=(d/2)(d+1)-d entries. 2) Take a uniform sample of n.tri possible correl

[R] Generate multivariate normal data with a random correlation matrix

2011-02-09 Thread Rick DeShon
Hi All. I'd like to generate a sample of n observations from a k dimensional multivariate normal distribution with a random correlation matrix. My solution: The lower (or upper) triangle of the correlation matrix has n.tri=(d/2)(d+1)-d entries. Take a uniform sample of n.tri possible correlations