Bayesian Estimation of NK Model


I am trying to estimate the behavioural New Keynesian Model of Gabaix (2018) using US data. I have learned how to code the model in Dynare and I have done that already. However, I do not know how to proceed from here to estimate the model using Bayesian technique. gabaix_new.mod (1.4 KB) Could you please tell me the procedure after this?
Thanks in anticipation.

Best Regards

Kindly check this mod file (estimation is done using Bayesian technique):

It provides replication files for

  • Smets, Frank and Wouters, Rafael (2007): “Shocks and Frictions in US Business Cycles: A Bayesian DSGE Approach”, American Economic Review, 97(3), 586-606

Thank you for reply.
Could you please tell me that after writing the model equations and shocks, we need to write the estimated parameters.

My problem here is that I do not know where to find these estimated parameters and how.

Could you please help me?

Thank you.

What do you mean with


I’m at the early stages of learning dynare. I, now, know how to simulate a model (by writing var, varexo, parameters and their calibration, model, steady, check, shocks, varobs and stoch_simul). Now, I need to estimate the same model using Bayesian technique and as I checked sample mod files for estimation, it processed as- var, varexo, parameters, model, shocks, ESTIMATED_PARMS, steady_state_model and estimation.
I need to understand how I will get the estimated parameters to write under estimated_parms.

You as the model builder need to have an idea which parameter value are unknown and need to be assigned values based on data used for estimation.

1 Like

Hi Sahil, you don’t need to find these estimated parameters. Since you are estimating them using Bayesian methods, you need to specify values of the prior distribution of your parameters (grey curve) and dynare will estimate the posterior distribution of the parameters (black curve). The value of the estimated parameter is the mean of the posterior distribution (dotted green line). You may want to read more on Bayesian statistics and inference.

The values you choose for the prior parameters (INITVAL, LB, UB, PRIOR_SHAPE, PRIOR_P1 or PRIOR_MEAN, PRIOR_P2 or PRIOR_STANDARD_ERROR, PRIOR_P3, PRIOR_P4, JSCALE) depends on your beliefs about the parameter as a researcher. Read the dynare guide for an explanation of these prior parameters.

As for how to know which prior parameter values are appropriate, I suggest you read chapter 2 of Bayesian Estimation of DSGE Models (by Edward P. Herbst and Frank Schorfheide). It discusses how to choose prior parameters (INITVAL, LB, UB, PRIOR_SHAPE, PRIOR_P1 or PRIOR_MEAN, PRIOR_P2 or PRIOR_STANDARD_ERROR, PRIOR_P3, PRIOR_P4, JSCALE), and also how to choose prior distributions (beta_pdf, gamma_pdf, normal_pdf, uniform_pdf, inv_gamma_pdf, inv_gamma1_pdf, inv_gamma2_pdf). Maybe you may want to read other chapters too if really want to get into bayesian estimation. I hope this helps.

1 Like

Dear Emmanuel,
Thank you for your reply. Your reply helps and I will read the book you’ve suggested.
Thank you


Dear Sahil

I tried to estimate gabaix approach. See attachment
model_gabaix.mod (1.3 KB)

Also editors asked to include in the model exhchange rates, terms of trade, inertia of inflation and of interest rate.

1 Like

Dear Dr. Shults

Thank you, I will keep this in mind.

Best Regards