WIP: Correlation positive semi definite

(keeping track of unmerged branches)

In some cases estimates of covariance and correlation matrices are not positive semi definite.  see issue #303

some helper functions to find a positive semi definite matrix that is "close"

no unit tests, with examples