Skip to content
Snippets Groups Projects
Commit 49610d4d authored by Sébastien Villemot's avatar Sébastien Villemot
Browse files

Fix bug in the output of stoch_simul: in the presence of non-stationary...

Fix bug in the output of stoch_simul: in the presence of non-stationary variables, and when selecting only a subset of variables for the output, the "NaN"s in the "mean" column where wrongly placed
(cherry picked from commit 9d67555f)
parent 6ed3f9a9
No related branches found
Tags
No related merge requests found
...@@ -37,9 +37,7 @@ end ...@@ -37,9 +37,7 @@ end
[oo_.gamma_y,stationary_vars] = th_autocovariances(dr,ivar,M_,options_); [oo_.gamma_y,stationary_vars] = th_autocovariances(dr,ivar,M_,options_);
m = dr.ys(ivar); m = dr.ys(ivar);
non_stationary_vars = setdiff(1:length(ivar),stationary_vars); non_stationary_vars = setdiff(1:length(ivar),stationary_vars);
ivar1 = intersect(non_stationary_vars,ivar); m(non_stationary_vars) = NaN;
m(ivar1) = NaN;
i1 = find(abs(diag(oo_.gamma_y{1})) > 1e-12); i1 = find(abs(diag(oo_.gamma_y{1})) > 1e-12);
s2 = diag(oo_.gamma_y{1}); s2 = diag(oo_.gamma_y{1});
......
...@@ -19,13 +19,12 @@ function [Gamma_y,stationary_vars] = th_autocovariances(dr,ivar,M_,options_,node ...@@ -19,13 +19,12 @@ function [Gamma_y,stationary_vars] = th_autocovariances(dr,ivar,M_,options_,node
% Gamma_y{nar+2} [double] Variance decomposition. % Gamma_y{nar+2} [double] Variance decomposition.
% Gamma_y{nar+3} [double] Expectation of the endogenous variables associated with a second % Gamma_y{nar+3} [double] Expectation of the endogenous variables associated with a second
% order approximation. % order approximation.
% stationary_vars [integer] Vector of indices of stationary % stationary_vars [integer] Vector of indices of stationary variables (as a subset of 1:length(ivar))
% variables in declaration order
% %
% SPECIAL REQUIREMENTS % SPECIAL REQUIREMENTS
% %
% Copyright (C) 2001-2009 Dynare Team % Copyright (C) 2001-2010 Dynare Team
% %
% This file is part of Dynare. % This file is part of Dynare.
% %
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment