Replace globals in disp_th_moments.m by function arguments

time-shift
Johannes Pfeifer 2015-08-17 08:57:07 +02:00
parent f7ae5e4f60
commit 38d293b864
3 changed files with 4 additions and 6 deletions

View File

@ -106,7 +106,7 @@ if ismember('moments', varargin) % Prior simulations (2nd order moments).
% Solve model
[dr,info, M_ ,options_ , oo_] = resol(0, M_ , options_ ,oo_);
% Compute and display second order moments
disp_th_moments(oo_.dr,[]);
oo_=disp_th_moments(oo_.dr,[],M_,options_,oo_);
skipline(2)
donesomething = true;
end

View File

@ -1,7 +1,7 @@
function disp_th_moments(dr,var_list)
function oo_=disp_th_moments(dr,var_list,M_,options_,oo_)
% Display theoretical moments of variables
% Copyright (C) 2001-2013 Dynare Team
% Copyright (C) 2001-2015 Dynare Team
%
% This file is part of Dynare.
%
@ -18,8 +18,6 @@ function disp_th_moments(dr,var_list)
% You should have received a copy of the GNU General Public License
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
global M_ oo_ options_
nodecomposition = options_.nodecomposition;
if size(var_list,1) == 0

View File

@ -157,7 +157,7 @@ if options_.nomoments == 0
elseif options_.periods == 0
% There is no code for theoretical moments at 3rd order
if options_.order <= 2
disp_th_moments(oo_.dr,var_list);
oo_=disp_th_moments(oo_.dr,var_list,M_,options_,oo_);
end
else
oo_=disp_moments(oo_.endo_simul,var_list,M_,options_,oo_);