Hi George,
"G. Perendia" george@perendia.orangehome.co.uk a écrit :
Can you please confirm how is the 2D matrix Hessian that is coming from <model>_dynamic.c/dll created and organised (and, similarly the sparse hessian from the matlab .m version),
The hessian matrix is a 2D array. If we denote by n the number of lines of the Jacobian (i.e. number of equations of the model), and by m the number of columns of the Jacobian (i.e. number of dynamic endogenous + exogenous), then the Hessian is a n by m^2 array.
The 2nd derivative of equation i=1..n with respect to variables j=1..m and k=1..m is stored in element (n, j+m*(k-1)) of the Hessian. By symmetry, it is also in element (n, k+m*(j-1)).
Otherwise, I have now fixed the bug that you reported earlier. Now, the dynamic DLL file returns a sparse array for the Hessian, so that dr1.m no longer fails at the place which you mentionned.
For your own purposes, I have understood that you need a full hessian (instead of a sparse one). Can you confirm this? If it is the case, then I shall implement the "pertub_dll" option (as suggested by Michel), so that the preprocessor gives you a full hessian in that case.
Best,