23 February 2011

Cross-correlated shocks

by Jaromir Benes

No problem any longer. You can set cross-correlation between any two shocks using a new syntax.

Either of the following three ways gets you where you want to be:

m.corr_SHOCK1__SHOCK2 = 0.55;

m = assign(m,'corr_SHOCK1__SHOCK2',0.55);

P = struct();
P.corr_SHOCK1__SHOCK2 = 0.55;
...
m = assign(m,P);
where obviously m is a model object, and SHOCK1 and SHOCK2 are the names of two shocks existing in that model object. Note that the shock names are separated by a double underscore. Now, what happens if you use
m.corr_SHOCK2__SHOCK1 = 0.55;
instead? IRIS behaves as you'd expect: The order of appearance of the two shock names does not matter. In other words, the two above examples refer to exactly the same cross-correlation coefficient.

On top of simply referring to m.corr_SHOCK1__SHOCK2, you can use the function get to access all the currently assigned cross-correlation coefficients:

get(m,'corr')
get(m,'nonzeroCorr')
The latter returns a database with only non-zero correlations (all correlations are zero by default) which is useful whenever the number of shocks is rather large (and hence the full database of correlations is larger still). Note that in either case, the returned database only contains corr_SHOCK1__SHOCK2 and not corr_SHOCK2__SHOCK1 where we assume that SHOCK1 has been declared before SHOCK2 in the underlying model file.

Otherwise, the cross-correlation coefficients can be used basically the same way as std deviations. For instance, you can estimate them, or you can specify time-varying correlations in forcast or filter. The only real limitation is that any non-zero correlation between a measurement shock and a transition shock is ignored in the Kalman filter, i.e. in functions like filter, loglik, estimate. This is so without IRIS throwing an error or warning.

No comments:

Post a Comment