I'm given a matrix. How do I find the nearest (or a near) positive definite from it?
The matrix can have complex eigenvalues, not be symmetric, etc. However, all its entries are real valued. The resulting matrix from the algorithm must be positive definite, with all its entries real valued only. Symmetry is a plus, but not necessary. I have no preference toward the metric used. I prefer a pragmatic(relatively easy to programme) approach. It doesn't have to be optimal.
nearPD
replaces $X$ with $\frac12(X+X^\top)$ for non-symmetric $X$.) $\endgroup$