Re: mvnrnd and positive semidefinite covariance matrices
- From: ellieandrogerxyzzy@xxxxxxxxxxxxxxxxxxxxxx (Roger Stafford)
- Date: Mon, 13 Mar 2006 20:03:40 GMT
In article <ef2c0c9.-1@xxxxxxxxxxxxxxxx>, "Frank Wu"
<frank.z.wu@xxxxxxxxx> wrote:
Hi. Newbie question here.----------------
Does anyone know why Matlab's mvnrnd function requires that the
covariance matrix be positive semidefinite? Is it possible to
generate random numbers from a multivariate normal distribution whose
covariance matrix is not positive semidefinite?
As context: I'm currently using the mvnrnd function to generate
random portfolio returns based off of random asset class
performances. Because the covariance matrix of the asset classes is
not positive semidefinite, I've had to use a conversion, which leads
to the portfolio not quite having the distribution that I expected.
Thanks!
By the very definition of covariance, the covariance matrix for any set
of real random variables must always be positive semidefinite! This can
be demonstrated as follows.
Let x1, x2, ..., xn be any set of real-valued random variables and
define y1 = x1-mean(x1), y2 = x2-mean(x2), ..., yn = xn-mean(xn). Let y
be the n x 1 vector [y1;y2;...;yn]. Let t be any real n x 1 vector. Then
the real scalar quantity (t'*y)^2 must always be non-negative, so its
expected value is also non-negative:
E{(t'*y)^2} = E{(t'*y)*(y'*t)} = E{t'*(y*y')*t} = t'*E{y*y'}*t >= 0
The quantity E{y*y'} is by definition the covariance matrix of the random
variables, x1, x2, ..., xn, and the fact that the above inequality holds
for all t is the condition for positive semidefiniteness of the matrix.
In particular, the covariance matrix for 'mvnrnd' must be positive
semidefinite, as well as that for any other kinds of random variables, no
matter what their joint distribution, including presumably your "random
asset classes". (Note that the phrase "semi" is essential here to allow
for random variables which might be totally correlated in some way.)
(Remove "xyzzy" and ".invalid" to send me email.)
Roger Stafford
.
- Follow-Ups:
- Re: mvnrnd and positive semidefinite covariance matrices
- From: Frank Wu
- Re: mvnrnd and positive semidefinite covariance matrices
- References:
- mvnrnd and positive semidefinite covariance matrices
- From: Frank Wu
- mvnrnd and positive semidefinite covariance matrices
- Prev by Date: Function handles stored with figure don't work
- Next by Date: Re: Speech recognition source code in Matlab or c++
- Previous by thread: Re: mvnrnd and positive semidefinite covariance matrices
- Next by thread: Re: mvnrnd and positive semidefinite covariance matrices
- Index(es):
Relevant Pages
|
Loading