Prior Predictive Analysis

Dear all,

Is there a short way of implementing prior analysis similar to this paper: Clearing Up the Fiscal Multiplier Morass in Dynare.

What I ask is not bayesian estimation in Dynare. I want to assign prior distributions to some parameters and then update parameter for each iteration then look at the 90 percentile.

I’ve seen some topics on this which use loops in dynare or matlab but due to the large iteration I try to find an efficient way not to solve the model for each iteration.

Thank you.

Yes, Dynare ships an example how to use the prior_function to do this:

Profess Pfeifer,
Thank you. Is there restrictions for parameters to be function in the prior_function file ? Or we simply use the parameters of interest in that function file ?

Thank you.

What do you mean with

?

Hello Professor Pfeifer,

I think I was confused about the composite parameters. We can still use this file if we don’t have composite parameters as in prior restriction m file? I tried to run Gali_2015.mod but for some reasons I get errors with dynare 4.5.7 and matlab 2022a. Is there a missing datatomfile script in the repository ?

Thank you.

  1. The composite parameter case is just one example for which you can conduct a prior predictive.
  2. Please use Dynare 6. You will find all necessary files in the shipped examples subfolder of your installation.

Professor Pfeifer,

Thank you. I am not sure about the best approach to do this:

  • I calibrated the model but I want to draw parameter values from prior distribution by taking random draws from those distributions.
  • After repeating this N times, I try to save the irfs.
  • Then I want to plot some variables with 90/95 percentiles of saved irfs similar to the paper I posted above.
    I use order 3, therefore I am not sure how to approach. I wrote a matlab file to loop over a parameter as an example but it doesn’t seem efficient and reasonable due to the large draw.

Is it possible to implement those steps using Gali_2015 codes ?

basecode.mod (5.4 KB)

drawparam.m (711 Bytes)

Thank you.

Try the attached and consider using IRFs at the stochastic steady state.

get_IRFS_prior.m (2.9 KB)
basecode.mod (5.5 KB)

Professor Pfeifer,

Thank you very much. I get this error: line 163, cols 50-63: syntax error, unexpected NAME which corresponds to nomodelsummary option in stock_simul.

I get this error when I remove that part and run:

EXECUTE_POSTERIOR_FUNCTION: Execution of prior/posterior function led to an error. Execution cancelled.
Error using stoch_simul
Too many input arguments.

Error in get_IRFS_prior (line 56)
[info, oo_] = stoch_simul(M_, options_, oo_, {‘Y’});

Error in execute_prior_posterior_function (line 87)
junk=functionhandle(parameter_mat(1,:),M_,options_,oo_,estim_params_,bayestopt_,dataset_,dataset_info);

Error in basecode (line 398)
oo_ = execute_prior_posterior_function(‘get_IRFS_prior’, M_, options_, oo_, estim_params_, bayestopt_, dataset_, dataset_info, ‘prior’);

Error in dynare (line 235)
evalin(‘base’,fname) ;

You need to use Dynare 6.