[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Correlating samples generated by randn

From: Dirk Eddelbuettel
Subject: Re: Correlating samples generated by randn
Date: Thu, 24 Jan 2002 12:20:46 -0600
User-agent: Mutt/1.3.25i

On Thu, Jan 24, 2002 at 07:11:42PM +0100, Pascual Mu?oz Mu?oz wrote:
> I want to use randn to generate a random process realization where each
> sample in the realization is correlated with some of its neighboor
> samples. Is this possible in Octave? How?

If C is the covariance matrix you want to use, then

   n = rows(C);
   Q = chol(C);                 # so that Q'*Q equals C
   X = Q'*randn(n,1);           # multivariate Normal(Zero, C)


Good judgment comes from experience; experience comes from bad judgment. 
                                                            -- F. Brooks

Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:
How to fund new projects:
Subscription information:

reply via email to

[Prev in Thread] Current Thread [Next in Thread]