Computation of the loss function in the presence of unit root variables was incorrect

Some elements were simply left out. This commit now mimics the computations as in th_autocovariances.m and makes sure the loss function coincides with the one that is obtained by reading out the covariance from oo_.var
time-shift
Johannes Pfeifer 2014-11-03 18:05:15 +01:00
parent 669016167e
commit cb5d3df6a0
1 changed files with 2 additions and 5 deletions

View File

@ -48,16 +48,13 @@ n = length(i_var);
[vx,u] = lyapunov_symm(A,B*Sigma_e*B',options_.qz_criterium,options_.lyapunov_complex_threshold, [], [], options_.debug);
if size(u,2) > 0
i_stat_0 = find(any(abs(A*u) < options_.Schur_vec_tol,2));
i_stat = find(any(abs(ghx*u) < options_.Schur_vec_tol,2));
i_stat = find(any(abs(ghx*u) < options_.Schur_vec_tol,2)); %only set those variances of objective function for which variance is finite
ghx = ghx(i_stat,:);
ghu = ghu(i_stat,:);
else
i_stat_0 = 1:size(ghx,2);
i_stat = (1:n)';
end
vx1 = Inf*ones(n,n);
vx1(i_stat,i_stat) = ghx(:,i_stat_0)*vx(i_stat_0,i_stat_0)*ghx(:,i_stat_0)'+ghu*Sigma_e*ghu';
vx1(i_stat,i_stat) = ghx*vx*ghx'+ghu*Sigma_e*ghu';