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
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
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
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
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
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
6 matches
Mail list logo