How can I convert a negative definite matrix into positive definite matrix?
15 ビュー (過去 30 日間)
古いコメントを表示
I want to convert matrix a=[-5 2; 6 1] into positive definite matrix.
2 件のコメント
Roger Stafford
2014 年 7 月 15 日
The matrix a = [-5 2; 6 1] is not negative definite! The expression z'*a*z for the column vector z can be either positive or negative depending on z. In other words, it has both a negative and a positive eigenvalue.
What kind of conversion do you allow on 'a' while endeavoring to make it positive definite?
採用された回答
Roger Stafford
2014 年 7 月 18 日
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.
1 件のコメント
Matt J
2014 年 7 月 18 日
編集済み: Matt J
2014 年 7 月 24 日
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.
That's true, but there are still situations when it can make sense to compute a positive definite approximation to the Hessian. When you are not at a point of zero gradient, you still need some way of finding a direction of descent when there are non-positive eigenvalues. The Newton direction, computed from a non-positive definite Hessian, can be unreliable as a way of computing a direction of descent. Consider, for example a function which looks locally like the following at x=y=0
f(x,y)= (x^2-y^2)/2 + x + y
The non-zero gradient [1,1] at x=y=0 tells you that you are not at a local minimum, yet the Newton direction, computed from the exact Hessian and gradient, is the vector [0,0] and gives no information about where to step. The best you can do is step in the direction of the gradient or some positive definite scaling of it. This would be equivalent to taking a Newton step with some positive definite substitute for the Hessian.
その他の回答 (1 件)
Matt J
2014 年 7 月 18 日
編集済み: Matt J
2014 年 7 月 18 日
You could switch temporarily to steepest descent at iterations where the Hessian is found to have negative eigenvalues. This is equivalent to replacing the Hessian with eye(N), which is of course positive definite.
Alternatively, you might be able to get better use of the Hessian if you do something similar to the Levenberg-Marquardt method, i.e., for some lambda>0
[V,D]=eig(Hessian);
d=diag(D);
Hessian=Hessian + eye(size(Hessian))*(lambda - min(d))*(d<0);
However, the best alternative might be to use an Optimization Toolbox solver, if you have it. The trust-region algorithm of fminunc, for example, can take advantage of negative Hessian eigenvalues to get further descent at zero gradient points, along the lines of what Roger was saying.
9 件のコメント
Matt J
2014 年 7 月 23 日
dmin=min(d);
Hessian=Hessian + eye(size(Hessian))*(lambda - dmin)*(dmin<0);
参考
カテゴリ
Help Center および File Exchange で Linear Algebra についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!