Re: question in generating draws



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
.



Relevant Pages

  • Re: mvnrnd and positive semidefinite covariance matrices
    ... covariance matrix is not positive semidefinite? ... to the portfolio not quite having the distribution that I expected. ... of real random variables must always be positive semidefinite! ...
    (comp.soft-sys.matlab)
  • Re: Q: properties of covariance matrices
    ... >Let x and y be n-tuplets of normally distributed random variables, ... > C = covbe the nxn covariance matrix of x and y. ... every positive semidefinite matrix is the covariance matrix of some ...
    (sci.math)
  • Re: Q: properties of covariance matrices
    ... >Let x and y be n-tuplets of normally distributed random variables, ... > C = covbe the nxn covariance matrix of x and y. ... every positive semidefinite matrix is the covariance matrix of some ...
    (sci.physics)
  • Re: Hilbert spaces in stochastics
    ... >>I don't know if this is a facile comment, ... >>random variables the covariance matrix can be used to construct an ... Reproducing kernel Hilbert ...
    (sci.math.research)

Loading