Comparing model with data after log-linearization

This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location where you will have to reset your password.
Forum rules
This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location (https://forum.dynare.org) where you will have to reset your password.

Comparing model with data after log-linearization

Postby missredridinghood » Sun Nov 23, 2014 11:48 pm

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.
missredridinghood
 
Posts: 19
Joined: Tue Nov 11, 2014 12:37 am

Re: Comparing model with data after log-linearization

Postby jpfeifer » Tue Nov 25, 2014 7:14 am

Could you please explain exactly what you are trying to achieve and what the problem is.
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: Comparing model with data after log-linearization

Postby missredridinghood » Tue Nov 25, 2014 12:59 pm

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?
missredridinghood
 
Posts: 19
Joined: Tue Nov 11, 2014 12:37 am

Re: Comparing model with data after log-linearization

Postby jpfeifer » Tue Nov 25, 2014 1:38 pm

Ideally, you compare HP-filtered, log data moments with the HP-filtered theoretical moments from the model (the hp_filter option of stoch_simul).
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: Comparing model with data after log-linearization

Postby missredridinghood » Sun Jan 25, 2015 1:25 pm

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?
missredridinghood
 
Posts: 19
Joined: Tue Nov 11, 2014 12:37 am

Re: Comparing model with data after log-linearization

Postby jpfeifer » Tue Jan 27, 2015 5:12 pm

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.
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: Comparing model with data after log-linearization

Postby Grant » Wed Jan 28, 2015 10:36 am

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!
Grant
 
Posts: 95
Joined: Tue Jun 10, 2014 2:37 pm

Re: Comparing model with data after log-linearization

Postby jpfeifer » Wed Jan 28, 2015 11:10 am

As documented in the referenced Guide, the HP filter automatically demeans the data. You just need to log and HP filter them.
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: Comparing model with data after log-linearization

Postby Grant » Wed Jan 28, 2015 11:25 am

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!
Grant
 
Posts: 95
Joined: Tue Jun 10, 2014 2:37 pm

Re: Comparing model with data after log-linearization

Postby jpfeifer » Thu Jan 29, 2015 6:42 pm

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.
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: Comparing model with data after log-linearization

Postby Grant » Sat Jan 31, 2015 7:15 am

Dear Jpfeifer,

Thanks for your advice. It is very helpful.

Regards,

FENG Ning
Grant
 
Posts: 95
Joined: Tue Jun 10, 2014 2:37 pm

Re: Comparing model with data after log-linearization

Postby AS90 » Sun Feb 15, 2015 1:06 pm

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.
AS90
 
Posts: 39
Joined: Tue Jul 23, 2013 3:22 pm

Re: Comparing model with data after log-linearization

Postby jpfeifer » Mon Feb 16, 2015 12:25 pm

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.
Attachments
Comparing_Model_and_VAR_IRFs.pdf
(108.49 KiB) Downloaded 306 times
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: Comparing model with data after log-linearization

Postby AS90 » Mon Feb 16, 2015 4:44 pm

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.
AS90
 
Posts: 39
Joined: Tue Jul 23, 2013 3:22 pm

Re: Comparing model with data after log-linearization

Postby jpfeifer » Thu Feb 19, 2015 9:12 am

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.
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Next

Return to Dynare help

Who is online

Users browsing this forum: Google [Bot] and 8 guests