Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error using hessizero (line 51) #6

Open
heqiang1122 opened this issue Mar 16, 2018 · 5 comments
Open

Error using hessizero (line 51) #6

heqiang1122 opened this issue Mar 16, 2018 · 5 comments

Comments

@heqiang1122
Copy link

Hello, I run this code in matlab 2017b with default settings,and got this:

Hessian Element: (23 23)Error using hessizero (line 51)
negative diagonal in hessian

Error in gibb (line 120)
hessian = hessizero('objfcndsge',[params,para_mask],1,...

Error in Main (line 37)
gibb

Error in run (line 91)
evalin('caller', strcat(script, ';'));

Could you please help me with this problem? Thank you.

@pearlzli
Copy link
Collaborator

Just to make sure, are you using the most recent commit (currently 22d7d87)? This problem was hopefully addressed in #5.

Also, as I say there, this code was written for MATLAB 09a, and we can't guarantee that base MATLAB functionality hasn't changed between versions.

@heqiang1122
Copy link
Author

heqiang1122 commented Mar 30, 2018 via email

@ikarib
Copy link
Contributor

ikarib commented May 8, 2020

To fix the problem with negative hessian diagonal, change you lyap_nonstationary.m and replace line
P0 = dlyap(T,R*Q*R');
by
V=R*Q*R'; nb=size(T,1); P0 = reshape((eye(nb^2)-kron(T,T))\V(:),nb,nb);

@heqiang1122
Copy link
Author

heqiang1122 commented May 9, 2020 via email

@alessandrocaiani
Copy link

I also have the same issue. Tried to solve as suggested above (#6 (comment)): it seems to work but it slowdowns the speed of the estimation procedure considerably (10 or more times slower).
Any idea on how to solve this issue and keep on using dlyap so to preserve execution speed?
Many thanks in advance!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants