s-news
[Top] [All Lists]

Re: simulate correlation matrices

To: "'Eric Zivot'" <ezivot@u.washington.edu>, S-News <s-news@lists.biostat.wustl.edu>
Subject: Re: simulate correlation matrices
From: Vadim Ogranovich <vograno@arbitrade.com>
Date: Mon, 25 Feb 2002 20:56:20 -0600
Here is one possible way.

You can first generate a positive semi-definite matrix of covariances, cov,
and then convert it to the correlation matrix: cor[i,j] =
cov[i,j]/sqrt(cov[i,i]*cov[j,j]). You can use ?outer function to do it
efficiently.

In turn, the covariance matrix can, for example, be generated as
x <- matrix(rnorm(5*5), ncol=5)
cov <- t(x) %*% x

P.S. Note that non-negative determinant is a necessary, but not sufficient,
condition for a matrix to be a covariance matrix. You need a stronger
property of being semi-definite

-----Original Message-----
From: Eric Zivot [mailto:ezivot@u.washington.edu]
Sent: Monday, February 25, 2002 6:02 PM
To: S-News
Subject: [S] simulate correlation matrices


I am trying to simulate random 5 x 5 correlation matrices and I am getting
negative determinants for some of the correlation matrices. Apparently, my
method is not working. Does anyone have a reliable method for generating
valid arbitrary correlation matrices? thanks, ez

Eric Zivot
Associate Professor
Department of Economics
Box 353330
University of Washington
(206) 543-6715
http://faculty.washington.edu/ezivot
http://myprofile.cos.com/zivote47

--------------------------------------------------------------------
This message was distributed by s-news@lists.biostat.wustl.edu.  To
unsubscribe send e-mail to s-news-request@lists.biostat.wustl.edu with
the BODY of the message:  unsubscribe s-news

-------------------------------------------------- 
DISCLAIMER 
This e-mail, and any attachments thereto, is intended only for use by the
addressee(s) named herein and may contain legally privileged and/or
confidential information.  If you are not the intended recipient of this
e-mail, you are hereby notified that any dissemination, distribution or
copying of this e-mail, and any attachments thereto, is strictly prohibited.
If you have received this e-mail in error, please immediately notify me and
permanently delete the original and any copy of any e-mail and any printout
thereof. 

E-mail transmission cannot be guaranteed to be secure or error-free.  The
sender therefore does not accept liability for any errors or omissions in
the contents of this message which arise as a result of e-mail transmission.

NOTICE REGARDING PRIVACY AND CONFIDENTIALITY 

Knight Trading Group may, at its discretion, monitor and review the content
of all e-mail communications. 


<Prev in Thread] Current Thread [Next in Thread>