MATLAB: How to convert a negative definite matrix into positive definite matrix

MATLABpositive definite matrix

I want to convert matrix a=[-5 2; 6 1] into positive definite matrix.

Best Answer

The modified Newton's method attempts to find points where the gradient of a function is zero. If the Hessian at such a point is not positive definite, this will not in general be a point of local minimum value for the function but merely a stationary point. If it has a negative eigenvalue, then it most certainly will not be a local minimum.
All this is straightforward. However, I fail to see the point in arbitrarily adjusting the Hessian to force it to be positive definite. In doing so you are no longer adhering to the modified Newton's method, which is pointless. You are not going to find the minimum this way. If you were to succeed in making the Hessian positive definite at a point of zero gradient, you might erroneously jump to the conclusion that you had already arrived at a valid local minimum.
If you find yourself at a point of zero gradient where the Hessian has one or more negative eigenvalues, you need to temporarily abandon the Newton method and proceed down in the direction of one of the corresponding eigenvectors in order to descend further until you find a valid local minimum with all positive eigenvalues. Doing this is distinctly different from arbitrarily forcing all the eigenvalues of the Hessian to be positive. Sir Isaac would turn over in his grave at the very notion.