imaginary standard errors - fminunc
이전 댓글 표시
hello, I am using FMINUNC function to find the maximum of a function f. I have these two questions:
1) since FMINUNC minimizes, I take -f. Should I change the sign of the Hessian in order to find the standard errors?
2) sometimes when I run the code I got imaginary standard errors for some coefficients and real for others. This is happening because there are both positive and negative values on the diagonal of the inverse of the Hessian. Why is this happening? Do you know any procedure I can use to avoid this issue?
this is the code I am using to find the minimum and the standard errors:
[phat_UNC,fval,exitflag,output,grad,hessian]=fminunc('multinomial_under_over_KT',initial_values',options,data);
Cov_Var =hessian;
V = inv(Cov_Var);
S_var = diag(V);
Std_er = sqrt(S_var);
can anyone help me?
thanks
댓글 수: 2
Vaidyanathan Thiagarajan
2017년 8월 29일
편집: Vaidyanathan Thiagarajan
2017년 8월 29일
Hello domenico,
Can you please post your full code or if it is too large can you post a simplified version of your code? Also, can you clearly state the objective function that you are trying to minimize?
Here are some initial info on Hessian and Gradient :
Vaidyanathan
Tim Everaert
2019년 5월 20일
How did you solve it eventually? I am having the same problem... Thanks!
답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Write Constraints에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!