I have few likelihood functions prewritten. I try to optimize them through "fmincon" function. For my estimated parameters, I then want to find the Hessian computed at those values. Once I get the Hessian I am interested in taking the inverse of the hessian multiplied by minus, which is basically the Information Matrix. This Information matrix is the Variance-Covariance Matrix and the On-Diagonal elements give us the variance (Square root of it gives the standard error of the estimates). Unfortunatly, the some of the var-cov matrix on-diagonal elements are negative which does not makes sense as the var-cov has to be positive. Any help would be great, or any alternative way to compute standard errors.
% 10. Time-varying normal Copula lower = -5*ones(3,1); % in theory there are no constraints, but setting loose constraints sometimes helps in the numerical optimisation upper = 5*ones(3,1); theta0 = [log((1+kappa1)/(1-kappa1));0;0]; [ kappa10 LL10, EXITFLAG, OUTPUT, LAMBDA, GRAD, HESSIAN] = fmincon('bivnorm_tvp1_CL',theta0,,,,,lower,upper,,options,[u,v],kappa1) [LL10, rho10] = bivnorm_tvp1_CL(kappa10,[u,v],kappa1);