Path: news.mathworks.com!newsfeed-00.mathworks.com!newsfeed2.dallas1.level3.net!news.level3.com!postnews.google.com!p25g2000hsf.googlegroups.com!not-for-mail
From: Greg Heath <heath@alumni.brown.edu>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Generation of Correlated Data
Date: Sun, 17 Aug 2008 10:47:31 -0700 (PDT)
Organization: http://groups.google.com
Lines: 72
Message-ID: <193fc757-3622-4faa-b8ee-abf2fa117d70@p25g2000hsf.googlegroups.com>
References: <g7ri75$8hr$1@fred.mathworks.com> <g885b5$m3v$1@fred.mathworks.com> 
NNTP-Posting-Host: 68.39.98.10
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Trace: posting.google.com 1218995252 2377 127.0.0.1 (17 Aug 2008 17:47:32 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Sun, 17 Aug 2008 17:47:32 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: p25g2000hsf.googlegroups.com; posting-host=68.39.98.10; 
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 
Xref: news.mathworks.com comp.soft-sys.matlab:485914



On Aug 17, 1:27=A0am, "Roger Stafford"
<ellieandrogerxy...@mindspring.com.invalid> wrote:
> "Deva MDP" <devas...@gmail.com> wrote in message <g885b5$m3v
>
> $...@fred.mathworks.com>...
>
>
>
>
>
> > "Deva MDP" <devas...@gmail.com> wrote in message
> > <g7ri75$8h...@fred.mathworks.com>...
> > > Can some one tell how to generate two random data sets
> > > with known correlation, (say Corr. Coef. =3D 0.5)
> > devas...@gmail.com
>
> > Dear Friend,
>
> > Thank you for the support given. I undestood how to generate
> > two data vectors to a required correlatin between them.But
> > my problem is as follows which I couldn't clarify yet.
>
> > I have generated a correlated random vector with 3 columns
> > for a desired correlaton matrix. Though my work is
> > successful, still I don't know the theory behind this procedure.
> > The procedure adopted is as follows.
>
> > (1) Generated 3 random vectors with ndependently normally
> > dstributed entries. X=3D[x1 x2 x3]
> > Corr(X)=3D Identity matrix approximately.
>
> > (2) Then x is transformed in to Y by Y=3DX*c , where c=3D
> > squreroot of G (G s the ultimate correlation matrix of Y)
> > (c is +ve definte matrx)
> > The form of G =3D (1 g g;g 1 g;g g 1], g is the correlaton
> > between the formed vectors.
>
> > Thankful If you can kndly let me know the theory behind this
> > procedure.
>
> > Best regards
>
> > Devasiri
>
> =A0 For the sake of discussion suppose that your three independent normal=
ly
> distributed random variables x1, x2, and x3 have mean 0 and variance 1, s=
o
> that correlation and covariance are one and the same. =A0If c is the matr=
ix
> square root of the G you have defined, then the following holds true. =A0=
The
> covariance matrix of your n by 3 matrix Y =3D X*c is given by
>
> =A0E{Y'*Y} =3D E{(X*c)'*(X*c)} =3D E{c'*X'*X*c}
> =A0=3D c'*E{X'*X}*c =3D c'*I*c =3D c'*c =3D c*c =3D G
>
> Here I is the identity matrix for the covariance matrix of X, and c =3D c=
' because
> it is symmetric. =A0Thus Y has the desired covariances.
>
> =A0 Note that the same would be true for any positive definite G. =A0All =
you have to
> do is find its matrix square root (using eigenvector methods presumably.)

The matrix square root is obviously not unique. Why do you prefer
using eigenvector methods instead of SQRTM?

Hope this helps.

Greg