Re: question in generating draws
- From: ellieandrogerxyzzy@xxxxxxxxxxxxxxxxxxxxxx (Roger Stafford)
- Date: Tue, 15 Nov 2005 01:42:00 GMT
In article
<25327539.1132011778111.JavaMail.jakarta@xxxxxxxxxxxxxxxxxxxxxx>, haoling
<haoling_uk@xxxxxxxxxxxx> wrote:
> Consider an n by 1 vector of random variables X~N(0,sigma)where sigam is
an n by n covariance matrix. Is there a function in MATLAB that generates
draws of the vector X?? There are functions (such as randn) that produce
draws of a scalar x~N(0, sigmasquare), but, I don't know whether there is
one for a vector of random variable.
>
> Thank you in advance
----------------------
What you need is the 'mvnrnd' function in the Statistics Toolbox. If
you don't have that toolbox, you can make your own version by taking
appropriate linear combinations of a set of independent random variables
generated by the 'randn' function, so as to match your covariance matrix.
Let me or others know if you need help doing the latter.
(Remove "xyzzy" and ".invalid" to send me email.)
Roger Stafford
.
- Prev by Date: Re: third order ODE with ode45
- Next by Date: Re: fmincon & constr
- Previous by thread: fmincon & constr
- Next by thread: Re: question in generating draws
- Index(es):
Relevant Pages
|
Loading