I worked on a feature that I couldn’t find in the library. It takes as an input a non positive definite but symmetric matrix, and calculates the nearest positive definite matrix using a convergent algorithm.
The technique is described in Higham, Nick (2002) Computing the nearest correlation matrix - a problem from finance http://eprints.ma.man.ac.uk/232/01/covered/MIMS_ep2006_70.pdf
The method converges towards the nearest positive definite matrix. However due to rounding errors, the final results is never completely positive definite and the Cholesky decomposition always fails. To make it work I can “chop off” some digits from the values but this is a pretty ugly technique.
I wanted to know:
- Can a subject expert matter give me a hand with the code in order to fix these rounding issues?
- Where can this code be added to the library? In which file should the implementation be placed?