Page 1 of 2

Comparing model with data after log-linearization

PostPosted: Sun Nov 23, 2014 11:48 pm
by missredridinghood
After you log-linearize your model and you want to compare the model with data, what is the best approach?

I am asking that because I believe the results are actually deviations from the mean (steady-state).

Can someone please provide more insight into this?

Thanks.

Re: Comparing model with data after log-linearization

PostPosted: Tue Nov 25, 2014 7:14 am
by jpfeifer
Could you please explain exactly what you are trying to achieve and what the problem is.

Re: Comparing model with data after log-linearization

PostPosted: Tue Nov 25, 2014 12:59 pm
by missredridinghood
Hello Johannes,

I had just finished running my RBC model that contains labor, consumption, output and it worked. I used the log-linearized method and I wanted to compare how well the model works compared to the data.

I think that the output that Dynare puts out is in deviations from steady state. So, to transform the data, Would I have to also put them in the form of a deviation from the mean?

Re: Comparing model with data after log-linearization

PostPosted: Tue Nov 25, 2014 1:38 pm
by jpfeifer
Ideally, you compare HP-filtered, log data moments with the HP-filtered theoretical moments from the model (the hp_filter option of stoch_simul).

Re: Comparing model with data after log-linearization

PostPosted: Sun Jan 25, 2015 1:25 pm
by missredridinghood
I log-linearized the model by hand. This would mean that for the variables (denoted by xhat) I can compare the theoretical moments (via HP filter) with the HP filtered log moments? I get zeros for the _hat variables. How can I compare the data to the model in this case?

Re: Comparing model with data after log-linearization

PostPosted: Tue Jan 27, 2015 5:12 pm
by jpfeifer
Why do you get zeros? For the mean, that is expected. If it happens for the standard deviations, there is something wrong/odd.
To compare model variables in percentage deviations to the data, you need to obtain empirical data in percentage deviations from a trend. The easiest way is using the theoretical HP filter on the loglinearized model variables and comparing them to HP-filtered logged empircal data (See Pfeifer(2013): "A Guide to Specifying Observation Equations for the Estimation of DSGE Models" https://sites.google.com/site/pfeiferecon/Pfeifer_2013_Observation_Equations.pdf) for more details.

Re: Comparing model with data after log-linearization

PostPosted: Wed Jan 28, 2015 10:36 am
by Grant
Dear Jpfeifer,

I also also get zeros because the model is linear and thus the model variables in Dynare is the percentage deviation from the steady state. I can use the "hp_filter" in "stoch_simul" command and get theoretical moments. As for the data, do I just need to take log and then hp_filter the logged data? Do I need to demean the empirical data?

Thanks!

Re: Comparing model with data after log-linearization

PostPosted: Wed Jan 28, 2015 11:10 am
by jpfeifer
As documented in the referenced Guide, the HP filter automatically demeans the data. You just need to log and HP filter them.

Re: Comparing model with data after log-linearization

PostPosted: Wed Jan 28, 2015 11:25 am
by Grant
Dear Jpfeifer,

Let me make it clear. For a linear model (use the "model(linear)" command in dynare), I just need to use the "hp_filter" in the "stoch_simul" command to get theoretical moments. As for the data, I just need to take log first and then hp_filter the data series(of course, take seasonal adjustment in advance as in your reference paper). Am I right?

Thanks!

Re: Comparing model with data after log-linearization

PostPosted: Thu Jan 29, 2015 6:42 pm
by jpfeifer
I have to repeat myself. Treat data and model equally. If your model is in log deviations from steady state (loglinear) and you use the hp_filter option, you have HP filtered log deviations from steady state. Now, you can compare this to HP-filtered logged empirical data, because the latter will then also be in log deviations from the trend/steady state.

Re: Comparing model with data after log-linearization

PostPosted: Sat Jan 31, 2015 7:15 am
by Grant
Dear Jpfeifer,

Thanks for your advice. It is very helpful.

Regards,

FENG Ning

Re: Comparing model with data after log-linearization

PostPosted: Sun Feb 15, 2015 1:06 pm
by AS90
Dr. Pfeifer,

If one wished to compare non-stationary data in levels with data from a log-linearised DSGE model would he have to actually normalise the model by the non-stationary process (a_t/a_t-1, say) or not?

Moreover, would there not be a mismatch between, say, the effective IRFs in levels and the theoretical log-linearised ones?

I ask so for Barsky and Sims, in "Information, animal spirits and the meaning of innovations in consumer confidence", seem to have operated this comparison.

Thank you in advance.

Re: Comparing model with data after log-linearization

PostPosted: Mon Feb 16, 2015 12:25 pm
by jpfeifer
The standard convention is to compare moments from the data and from the model based on the same transformation, i.e. to for example use first differences for both.
In contrast, for IRFs it is common to compare VAR and model IRFs directly (also called the Cogley-Nason-Sims approach). There is a competing approach that demands estimating the VAR on model generated data. For details, see the attached slide from my Master lecture. The reference is Christiano, Lawrence J., Martin Eichenbaum, and Robert Vigfusson
(2006). “Assessing structural VARs”. NBER Macroeconomics Annual. Ed. by Daron Acemoglu, Kenneth Rogo˙, and Michael Woodford. National Bureau of Economic Research. Chap. 1, 1–106.

Re: Comparing model with data after log-linearization

PostPosted: Mon Feb 16, 2015 4:44 pm
by AS90
Obliged for the explanations.

So besides comparing theoretical IRFs and empirical IRFs (traditional approach) one may compare theoretical IRFs and ones from model simulated data (other approach)? Is that correct?

1. In any event, would comparing theoretical IRFs with empirical ones obtained from data in levels not create an appraisal mismatch when the model is log-linearised? Is it warranted?
2. Also, if one wishes to gauge non-stationary data, hence without abstracting from the BGP, should he normalise his nominal variables in the corresponding DSGE model or not?

Thanks sir.

Re: Comparing model with data after log-linearization

PostPosted: Thu Feb 19, 2015 9:12 am
by jpfeifer
I do not understand your questions. As shown in Sims Stock Watson 1992 - Inference in linear time series models with some unit roots, it does typically not matter much in VARs whether they are in levels or first differences. What you need to take care of is that your data is log levels if you want to compare it to percentage deviations. If your shock identifcation is correct, the IRFs from a VAR in log-levels will provide correct IRFs for deviations from the long-run trend.