Code covered by the BSD License  

Highlights from
Matrix Decomposition

5.0 | 1 rating Rate this file 19 Downloads (last 30 days) File Size: 903 KB File ID: #31296
image thumbnail

Matrix Decomposition



03 May 2011 (Updated )

Positive definite correlation matrix based on spectral decomposition. Now both for .m, C and Mex

| Watch this File

File Information

Matrix decomposition using, e.g. the Cholesky decomposition requires the correlation matrix to be positive definite. That is, the eigenvalues must all be positive. In finance, this is rarely the case, and one often observes negative eigenvalues, or zero eigenvalues. These two functions do essentially the same thing. One adjusts only the <= 0 eigenvalues, while the other adjusts those eigenvalues, but then also increases the other non-negative eigenvalues to compensate for the higher 'weight' given to the smaller eigenvalues.

Required Products Econometrics Toolbox
Financial Toolbox
Optimization Toolbox
Statistics and Machine Learning Toolbox
MATLAB release MATLAB 7.12 (R2011a)
Other requirements The C programming code implementation is optimized for Intel 64-bit CPUs.
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (4)
12 Aug 2014 Lorenzo


[Eig_Vec,~]=eig(Corr_Mat) this give me the following error:

Error: Unbalanced or unexpected parenthesis or bracket.

But I cannot figure out why. Do you have any idea? Thanks

Comment only
18 Nov 2012 Aleksander

The latest submission includes the function written in the C programming language, as well as a MEX implementation, thus providing significant speed and memory enhancements.

Comment only
03 Nov 2012 Aleksander

Does the trick!

Comment only
07 Jul 2011 Marco

Marco (view profile)

Very useful and efficient functions. Thanks to the willing and gentle author for the prompt and clear help.

20 Jul 2011

Removed one function

05 Nov 2012

Updated description

05 Nov 2012

Added screenshot

19 Nov 2012

This update includes the program in C programming code, as well as a MEX implementation, providing potentially significant speed and memory handling enhancements.

Contact us