Dear Sebastien
Can the preprocessor identify and set the number of the non-zero items in the Hessian as, e.g.:
M_.sparse_hessian_len
Best regards George
----- Original Message ----- From: "G. Perendia" george@perendia.orangehome.co.uk To: "List for Dynare developers" dev@dynare.org Sent: Friday, June 26, 2009 8:20 AM Subject: Re: [DynareDev] 2nd and 3rd model derivatives + k-order
Yes, writing it in M_ would help greatly. Best regards
George ----- Original Message ----- From: "Michel Juillard" michel.juillard@ens.fr To: "List for Dynare developers" dev@dynare.org Sent: Friday, June 26, 2009 7:30 AM Subject: Re: [DynareDev] 2nd and 3rd model derivatives + k-order
Good point! So the preprocessor needs to write in the main *.m file the number of non-zero elements (probably in M_.) and then k_order_perturbation can make the correct space available.
Best,
Michel
G. Perendia wrote:
Thanks Michel
I am well aware of the efficiency of sparse matrices being used for
Hessian
in general.
However, k-order-perturbation dll has problem in finding out what size matrix should be passed to dll to get the Hessian back in.. Not knowing
the
number of non-zero elements in advance can result in having to pass
between
two DLLs as much as 3 times larger matrix than the flat Hessian (for
both
data and indices) which can be rather large - and mostly empty!!
Best regards
George
----- Original Message ----- From: "Michel Juillard" michel.juillard@ens.fr To: "List for Dynare developers" dev@dynare.org Sent: Friday, June 26, 2009 7:11 AM Subject: Re: [DynareDev] 2nd and 3rd model derivatives + k-order
Hi George,
it is inefficient to pass full hessian from *_dynamic.m or *_dynamic.dll
In k_ord_dynare, one uses only non-zero elements to populate the
tensors.
The details of implementation will change again in the future, but passing only non-zero elements is a step in the right direction.
All the best,
Michel
G. Perendia wrote:
Dear Sebastien
If USE_DLL is going to be discontinued why is MEX/DLL now going to
return
sparse matrix exclusively when its only future use is for
k-ord-perturbation
which requires full matrix. Can we than have PERTURB_DLL option now and return full hessian using the existing (old) mex/dll dynamic model (but renamed e.g. <model>_kordpert.mexXX/dll) when that option is used
rather
than fixing k-ordpert rather unnecessarily and poss. just temporary
since
we
may revert to the full hessian returned form mex/dll once USE_DLL is abandoned.
I think to remember we initially agreed this course of action anyway.
In
your email from 9th April 09 you mention:
..."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."
And, there are actually quite few issues to be resolved for sparse
matrices
being returned from dll. For a start, one problem with fixing
k-ordpert
is
finding out what size matrix should be passed to dll to get hessian in:
i.e.
it may be as much as 3 times bigger than the flat hessian - which can
be
rather large!!
Best regards
George ----- Original Message ----- From: "Sébastien Villemot" sebastien.villemot@ens.fr To: "List for Dynare developers" dev@dynare.org Sent: Thursday, June 25, 2009 1:44 PM Subject: Re: [DynareDev] 2nd and 3rd model derivatives + k-order
Le jeudi 25 juin 2009 à 13:41 +0100, G. Perendia a écrit :
Just to recap, both dr1.m and k-order-perturbation.dll are affected
but
only
k-order-perturbation would need to be fixed to cope with this change
since
dr1.m will not be using USE_DLL mex option anyway.
Yes, indeed.
Dev mailing list Dev@dynare.org http://www.dynare.org/cgi-bin/mailman/listinfo/dev
Dev mailing list Dev@dynare.org http://www.dynare.org/cgi-bin/mailman/listinfo/dev
Dev mailing list Dev@dynare.org http://www.dynare.org/cgi-bin/mailman/listinfo/dev
Le vendredi 26 juin 2009 à 13:26 +0100, G. Perendia a écrit :
Can the preprocessor identify and set the number of the non-zero items in the Hessian as, e.g.:
M_.sparse_hessian_len
It's done.
The structure is M_.NNZDerivatives. It is a 3 elements vectors with non-zero derivatives for first, second and third order derivatives. So you're interested in M_.NNZDerivatives(2).
Best,