Variance of endogenous variables in OSR

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.

Variance of endogenous variables in OSR

Postby VAL » Tue Mar 11, 2014 12:01 am

In OSR computations, the variance-covariance matrix of endogenous variables appears to be different from the one reported by stoch_simul (order=1).

In OSR, the variance-covariance matrix is computed by the following code (last line of get_variance_of_endogenous_variables.m)
Code: Select all
vx1(i_stat,i_stat) = ghx(:,i_stat_0)*vx(i_stat_0,i_stat_0)*ghx(:,i_stat_0)'+ghu*Sigma_e*ghu';
while in stoch_simul, the matrix is computed as in line 143 of th_autocovariances.m
Code: Select all
v(stationary_vars,stationary_vars) = aa*vx*aa'+ bb*M_.Sigma_e*bb';

The difference between the two expressions is in the first term. While in stoch_simul the entire vx matrix is employed, in OSR only a sub matrix of vx identified by i_stat_0 indices is used. Numerically, the difference in terms of the value of the loss function (specified in OSR) is noticeable (20% for my model). Is there really a need for the two computations of the same matrix to be different?
VAL
 
Posts: 2
Joined: Mon Mar 10, 2014 11:21 pm

Re: Variance of endogenous variables in OSR

Postby jpfeifer » Tue Mar 11, 2014 9:06 am

I don't get the point. In OSR, only the variance for variables in the loss function are selected. But the big covariance matrices from which the entries are selected are identical.
------------
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: Variance of endogenous variables in OSR

Postby VAL » Tue Mar 11, 2014 4:10 pm

It is true that in OSR (in the line of code cited above) the variance-covariance matrix is computed only for the variables specified in the loss function. For example, if there are 3 variables in the loss function, the matrix is [3x3]. When running stoch_simul, I compute statistics for exactly the same variables. As a shortcut, the statistics can be also obtained by disp_th_moments(oo_.dr,['x1';'x2';'x3']).

The difference between the computations in osr and in stoch_simul lies in the computation of the first term in the two lines of code above. In OSR/get_variance_of_endogenous_variables because of i_stat_0 the dimension of matrices in the expression ghx(:,i_stat_0)*vx(i_stat_0,i_stat_0)*ghx(:,i_stat_0)' could be, for example, [3x50]x[50x50]x[50x3]. In stoch_simul/disp_th_moments the dimension of matrices in aa*vx*aa' could be [3x120]x[120x120]x[120x3]. In both cases, the resulting variance-covariance matrices are [3x3], but the matrices are not the same.

The issue seems to boil down to imposing abs(A*u)<options_.Schur_vec_tol in line 51 of get_variance_of_endogenous_variables.m (in addition to abs(ghx*u)<options_.Schur_vec_tol) and not imposing the restriction in th_autocovariances.m.
VAL
 
Posts: 2
Joined: Mon Mar 10, 2014 11:21 pm

Re: Variance of endogenous variables in OSR

Postby jpfeifer » Tue Mar 11, 2014 9:32 pm

I see. According to my understanding, this should only matter for unit root variables. Could you provide me with an example mod-file where the problem occurs?
------------
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


Return to Dynare help

Who is online

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