fmincon with constraints on eigenvalues
조회 수: 4 (최근 30일)
이전 댓글 표시
Hello everybody, I need to perform an optimization on matlab, I'm using fminsearch, but I realized that I need to put some constraints on a part of the parameter vector.
my parameter vector size is 20*1, I need the matrix :
K= Vec2mat(param(1:9),3) to have eigenvalues with positive real parts.
I wrote: [param, ML] = fmincon(@(param) Myfct(param,maturity,Data),param0,[],[],[],[],[],[],@Myconstr, options)
with the function Myconstr being:
function [c,ceq] = Myconstr(x) c = -real(eig(vec2mat(x(1:9),3)))'; ceq=[]; end
but it doesn't seem to work. Appreciate any help.
Thanks
댓글 수: 5
답변 (1개)
Matt J
2013년 3월 3일
편집: Matt J
2013년 3월 3일
As Shashank said, we need to see KalmanFilterCorr to know what's going on, but it looks like you have reached values for params(1:9) that are not finite and therefore EIG complains.
Using the DBSTOP command ("dbstop if naninf") will force MATLAB to pause execution at the point in the code where nan/inf values for params are generated. Then you can see what's going on.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Math Operations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!