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
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
Tim Everaert 2019 年 5 月 20 日
How did you solve it eventually? I am having the same problem... Thanks!

サインインしてコメントする。

回答 (0 件)

質問済み:

2017 年 8 月 26 日

コメント済み:

2019 年 5 月 20 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by