A question regarding fminunc
    4 views (last 30 days)
  
       Show older comments
    
Dear all,
I use the function fminunc having specified the components of optimset; that is;
 x00=cc;               options=optimset('LargeScale','off','display','off','TolFun',0.0001,'TolX',0.0001,...
'GradObj','off', 'Hessian','off','DerivativeCheck','off');
[xxx,,H]=fminunc('CES_mode7cut',x00,options,...             X1,delta,rlaggedvector,repphi1,fff2,fff3,fff4,fff5,fff6,varepsilon);
tmean = xxx; %  
tvcov = c*inv(H);  
cdraw=mvtrnd1(tmean,tvcov,v);  %proposal density
My problem is that the code gets stuck either at
 mvtrnd1(tmean,tvcov,v);
 Error using chol
Matrix must be positive definite.
 in mvtrnd1 (line 21)
L=chol(vcov)';
 Error in proposed_emprirical_moodys_predict (line 315)
              cdraw=mvtrnd1(tmean,tvcov,v);  %proposal
              density
or I get this message
 Error using fminusub (line 17)
Objective function is undefined at initial point.
Fminunc cannot continue.
 Error in fminunc (line 403)
   [x,FVAL,GRAD,HESSIAN,EXITFLAG,OUTPUT] =
   fminusub(funfcn,x, ...
 Error in proposed_her (line 309)
            [xxx,H]=fminunc('CES_mode7cut',x00,options,...
Is there a way to change the settings in optimset to avoid having these two errors?
0 Comments
Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!