File Exchange

image thumbnail

Finding a similar valid correlation matrix

version (471 Bytes) by Erlend Ringstad
The function transforms a suggested matrix to a valid correlation matrix


Updated 04 Apr 2016

View License

Implementation of Nicholas J. Higham's algorithm "Computing the Nearest Correlation Matrix - A Problem from Finance", 2002.

Cite As

Erlend Ringstad (2021). Finding a similar valid correlation matrix (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (4)

Jack Baker

I found this algorithm to be very slow and to not successfully converge for the problem I was working on. I found a number of useful implementations of this algorithm at, and found one there that worked better.


Hi Erlend, all,

first of all, many thanks for providing this useful tool. I used it to transform symmetric 80x80 correlation matrices (~1300 correlation matrices, one for each day during my observation period). I encountered 2 difficutlties: 1. The program took ages to complete (14 hours) (despite high-performance Xeon workstation) and the result was not satisfying because only 15 of the resulting transformed correlation matrices were positive-definite. Could you please comment on options to increase speed and how to ensure that the resulting matrices are positive-definite? Many thanks for your feedback

Andrea Carbone

I have found its use rather straightforward. Just pass the (quasi)correlation matrix for which you'd like to find the nearest valid correlation matrix (described in the reference above) ... and it's done.
The only parameter that you can tweak it seems to be the number of iterations that originally is set to 100 times the squared dimension of your problem.

Jos x@y.z

No (useful) help, no comments, no H1 line. How do you expect that anybody else than you is able to use this function properly ...

MATLAB Release Compatibility
Created with R2007a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!