Path: news.mathworks.com!not-for-mail
From: "Deva MDP" <devasiri@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Generation of Correlated Data
Date: Sun, 17 Aug 2008 07:26:01 +0000 (UTC)
Organization: Finnroad
Lines: 78
Message-ID: <g88jq9$qn5$1@fred.mathworks.com>
References: <g7ri75$8hr$1@fred.mathworks.com> <g885b5$m3v$1@fred.mathworks.com> <g88cr6$d72$1@fred.mathworks.com>
Reply-To: "Deva MDP" <devasiri@gmail.com>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1218957961 27365 172.30.248.35 (17 Aug 2008 07:26:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sun, 17 Aug 2008 07:26:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1443886
Xref: news.mathworks.com comp.soft-sys.matlab:485878



"Roger Stafford" <ellieandrogerxyzzy@mindspring.com.invalid>
wrote in message <g88cr6$d72$1@fred.mathworks.com>...
> "Deva MDP" <devasiri@gmail.com> wrote in message <g885b5$m3v
> $1@fred.mathworks.com>...
> > "Deva MDP" <devasiri@gmail.com> wrote in message
> > <g7ri75$8hr$1@fred.mathworks.com>...
> > > Can some one tell how to generate two random data sets 
> > > with known correlation, (say Corr. Coef. = 0.5)
> > devasiri@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=[x1 x2 x3]
> > Corr(X)= Identity matrix approximately.
> >  
> > (2) Then x is transformed in to Y by Y=X*c , where c=
> > squreroot of G (G s the ultimate correlation matrix of Y)
> > (c is +ve definte matrx)
> > The form of G = (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
> 
>   For the sake of discussion suppose that your three
independent normally 
> distributed random variables x1, x2, and x3 have mean 0
and variance 1, so 
> that correlation and covariance are one and the same.  If
c is the matrix 
> square root of the G you have defined, then the following
holds true.  The 
> covariance matrix of your n by 3 matrix Y = X*c is given by
> 
>  E{Y'*Y} = E{(X*c)'*(X*c)} = E{c'*X'*X*c}
>  = c'*E{X'*X}*c = c'*I*c = c'*c = c*c = G
> 
> Here I is the identity matrix for the covariance matrix of
X, and c = c' because 
> it is symmetric.  Thus Y has the desired covariances.
> 
>   Note that the same would be true for any positive
definite G.  All you have to 
> do is find its matrix square root (using eigenvector
methods presumably.)
> 
> Roger Stafford
> 
Dear Roger,

Thank you very much for your support.
I can understand that.But I got Corr(A*Y)=Corr(Y)
As I have the above thinking n my mind, still I find dffcult
to undestand the correlation relationship between X and Y
data sets.

Regards from

Devasiri