This project is read-only.

issue with observables in measurement equations

Topics: IRIS in General, Kalman Filtering, Models
Nov 19, 2014 at 8:31 PM
Hi Iris experts!

I am currently filtering and estimating a fairly large DSGE model in IRIS. The model is stationary (no unit root or deterministic trend). I have an issue putting it to the data.

I use hp-detrended data and big ratios (Consumption/GDP, Investment/GDP etc...) to filter the shocks and, in a second stage, to estimate some parameters.

After a while trying, to get reasonable shocks, I specified the following measurement equations, for example:

gdp_(i.e hp-detrended gdp) = gdp (i.e. model transition gdp variable) - &gdp (i.e. steady state of model gdp)

And similarly for big ratios:

ratioinvestment_ = ratioinvestment - &ratioinvestment,

where I put the data equilibrium for the ratios in the section !dtrends

ratioinvestment_ += 0.125;

Now, although the results look reasonable, I am not 100% sure that I am specifying things correctly. In particular, it is not totally clear to me why I have to to put equilibrium variables (&) on the right hand side of the measurement equations? I could find no other example in the available IRIS tutorials. When I omit them, the estimated shocks go all over the place!

Shortly stated, it is not clear to me what is the exact relation between the right and the left hand side variables in the measurement equations ! (with and w/o the inclusion of !dtrends variables).

Thanks in advance for your help!


Nov 19, 2014 at 9:54 PM
Edited Nov 19, 2014 at 9:59 PM
Hi Nico,

You can use both the !measurement_equations block and the !dtrends block to adjust the mean values of observed series as they relate to your structural model. How this works depends on the settings you're using when you call model/filter(). Allow me to quickly explain to make sure you are not adjusting the mean twice.

Let's suppose for discussion purposes that your (partial) model looks like this:


x_obs = a + x ;

x_obs += b ;
No matter what you do, x_obs will be the same in both your input and output database. Let's discuss the consequences for the variables in the structural model.
  1. If you set b to some non-zero value, then as long as you call model/filter() with 'dtrends=' set to either the default (auto) or true, then x_obs = x + b should hold numerically in your output database.
  2. If you set a to some non-zero value, then as long as you call model/filter() with 'deviation=' set to either the default (false) or false, then x_obs = x + a should hold numerically in your output database.
When using both !dtrends and constants in the measurement block simultaneously, I would be careful because both do similar things. You don't want to do both (1) and (2), above.

Also, if your output gap is HP filtered then it should be mean zero by construction. If it requires some mean adjustment then I would be concerned.
Marked as answer by jaromirbenes on 11/20/2014 at 3:56 AM
Nov 20, 2014 at 6:17 AM
Hi Mike,

Thanks for the quick reply.

To take your example: what if x and x_obs have both different means (e.g. x_obs is hp with mean zero and x has a non-zero steady state. In the model most of the level variables are expressed as exp(x) i.e. x = ln(X))? Specifically, would you recommend using 1. or 2. And by the way what is the default for filter(deviation=): auto or false?


Nov 20, 2014 at 11:56 AM
Edited Nov 20, 2014 at 11:57 AM
Hi Nico

default for 'deviation=' is false; however, the inclusion/exclusion of deterministic trends is controlled by yet another option, 'dtrends=' which is auto by default. This means, 'dtrends=' is true whenever 'deviation=' is false and vice versa.

Marked as answer by jaromirbenes on 11/20/2014 at 3:57 AM
Nov 20, 2014 at 7:56 PM
J and M, thanks very much for the clarification. Everything seems ok now. And maybe a little advice to users bringing data to the model (grown on painful experience): Detrend carefully!
Nov 20, 2014 at 7:57 PM
Very true, indeed!