User-defined function on the posterior draws
Dear Michel and Stephane, one and a half years ago, I proposed functionality to execute user-defined function on the posterior draws (https://github.com/DynareTeam/dynare/pull/417). Despite inquiring about the status repeatedly with Sebastien and Stephane, I never got any response and let the issue sleep. But now there are again two user questions in the forum that would require such a functionality: http://www.dynare.org/phpBB3/viewtopic.php?f=1 <http://www.dynare.org/phpBB3/viewtopic.php?f=1&t=6322> &t=6322 http://www.dynare.org/phpBB3/viewtopic.php?f=1 <http://www.dynare.org/phpBB3/viewtopic.php?f=1&t=6268&p=17939#p17939> &t=6268&p=17939#p17939 Thus, I would like to ask again, if there is a design issue that prevents offering such a functionality? Best, Johannes -- Johannes Pfeifer Friesenwall 104 50672 Köln Tel.: +49-221-29873852 Mobil.: +49-170-6936820 Germany
Hi Johannes, I'm not sure that we should attempt to provide this feature as an option of ESTIMATION. I can't think of a situation where one would use the results of this function inside Dynare. I would simply provide execute_posterior_function, maybe with another name, as a separate function, after running estimation. execute_posterior_function should return a unique output argument (possibly a cell, but we don't need to enforce it) provided by the user function. In the 'posterior' case, I would add an option to use only a fraction of all posterior draws. In the 'prior' case, I couldn't see how to indicate the number of prior draws. Best Michel Johannes Pfeifer writes:
Dear Michel and Stephane,
one and a half years ago, I proposed functionality to execute user-defined function on the posterior draws (https://github.com/DynareTeam/dynare/pull/417). Despite inquiring about the status repeatedly with Sebastien and Stephane, I never got any response and let the issue sleep.
But now there are again two user questions in the forum that would require such a functionality:
http://www.dynare.org/phpBB3/viewtopic.php?f=1 <http://www.dynare.org/phpBB3/viewtopic.php?f=1&t=6322> &t=6322
http://www.dynare.org/phpBB3/viewtopic.php?f=1 <http://www.dynare.org/phpBB3/viewtopic.php?f=1&t=6268&p=17939#p17939> &t=6268&p=17939#p17939
Thus, I would like to ask again, if there is a design issue that prevents offering such a functionality?
Best,
Johannes
-- Michel Juillard
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 Hi, I agree with Michel. I do not think that we should add this as an option to the estimation command (or in dynare_estimation_1 routine). I also do not think that we even need a preprocessor interface. Regarding the number of draws we already have routines to take an arbitrary number of draws in the posterior (ie in the mcmc draws) or in the prior and to save them on the disk. If I understand your code you use these generated files... But it is not obvious that these files are actually generated (before the call to execute_posterior_function). So we should test that NumberOfDrawsFiles is strictly greater than zero, and if not call a routine (selec_posterior_draws or prior_sampler) or ask the user to call one of this routines. We could add a routine sampler('posterior',n) sampler('prior',n) that would call selec_posterior_draws(n) or options_.prior_draws = n; prior_sampler(0,M_,bayestopt_,options_,oo_,estim_params_) depending on the value of the first argument. Best, Stéphane. Le 28/12/2014 16:21, Michel Juillard a écrit :
Hi Johannes,
I'm not sure that we should attempt to provide this feature as an option of ESTIMATION. I can't think of a situation where one would use the results of this function inside Dynare.
I would simply provide execute_posterior_function, maybe with another name, as a separate function, after running estimation. execute_posterior_function should return a unique output argument (possibly a cell, but we don't need to enforce it) provided by the user function.
In the 'posterior' case, I would add an option to use only a fraction of all posterior draws. In the 'prior' case, I couldn't see how to indicate the number of prior draws.
Best
Michel
Johannes Pfeifer writes:
Dear Michel and Stephane,
one and a half years ago, I proposed functionality to execute user-defined function on the posterior draws (https://github.com/DynareTeam/dynare/pull/417). Despite inquiring about the status repeatedly with Sebastien and Stephane, I never got any response and let the issue sleep.
But now there are again two user questions in the forum that would require such a functionality:
http://www.dynare.org/phpBB3/viewtopic.php?f=1 <http://www.dynare.org/phpBB3/viewtopic.php?f=1&t=6322> &t=6322
http://www.dynare.org/phpBB3/viewtopic.php?f=1 <http://www.dynare.org/phpBB3/viewtopic.php?f=1&t=6268&p=17939#p17939>
&t=6268&p=17939#p17939
Thus, I would like to ask again, if there is a design issue that prevents offering such a functionality?
Best,
Johannes
- -- Stéphane Adjemian Université du Maine, Dynare Team -----BEGIN PGP SIGNATURE----- iQQcBAEBCgAGBQJUoSYXAAoJEKbUTLnGTOd7Qh4gAKuuL12S5ht1afhH2MwWIGEu dGypXMOmyN2a0vwBYq/q7tU8u4kDIlOaGqWILeUAXqvE1vgU8phNdwigoXRV90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FBN2 rKfwpISIEQen0+dLAz2lSmkz/IGSAedRM2gC5VhxhHM/dCXYPGQ8MCzFGMwUjbpN j0a+LqMl52zgMH/Dv8J+tvs2zYwd62zLDLQ4uJIbOYnAvv76rSwW4wf4aZidpmD5 CeOuk9b6QugE8rHFg7cmvz6CCTAh+HrvjGxSRAuNEy1dWCZ9zr5Q5k4S0etF2Ck= =rF1i -----END PGP SIGNATURE-----
participants (3)
-
Johannes Pfeifer -
Michel Juillard -
Stéphane Adjemian