Re: mvnrnd and positive semidefinite covariance matrices
- From: Peter Perkins <Peter.PerkinsRemoveThis@xxxxxxxxxxxxx>
- Date: Mon, 13 Mar 2006 14:23:57 -0500
Frank Wu 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.
Hi Frank,
There is no such thing as a covariance matrix that is not positive definite/semidefinite, normal or otherwise. That would be like having a negative variance -- impossible by definition.
That being said, it is certainly possible to compute an _estimate_ of a cov matrix that is indefinite, not uncommon in the presence of missing data. See for example the help describing the 'rows' parameter to CORR. It's not always clear what to do in this situation.
It's also sometimes possible have a true cov matrix that is nearly singular, but end up with an estimate that has eigenvalues that are slightly negative due to small numerical errors -- that's an easy fix.
Hope this helps.
- Peter Perkins
The MathWorks, Inc.
.
- References:
- mvnrnd and positive semidefinite covariance matrices
- From: Frank Wu
- mvnrnd and positive semidefinite covariance matrices
- Prev by Date: Connecting together labeled regions
- Next by Date: Iteration code going wrong somewhere
- Previous by thread: mvnrnd and positive semidefinite covariance matrices
- Next by thread: Re: mvnrnd and positive semidefinite covariance matrices
- Index(es):
Relevant Pages
|