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 Kommentare

Vaidyanathan Thiagarajan
Vaidyanathan Thiagarajan am 29 Aug. 2017
Bearbeitet: Vaidyanathan Thiagarajan am 29 Aug. 2017
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 am 20 Mai 2019
How did you solve it eventually? I am having the same problem... Thanks!

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Gefragt:

am 26 Aug. 2017

Kommentiert:

am 20 Mai 2019

Community Treasure Hunt

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

Start Hunting!

Translated by