[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)
Dirk
--
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: http://www.octave.org
How to fund new projects: http://www.octave.org/funding.html
Subscription information: http://www.octave.org/archive.html
-------------------------------------------------------------