Removed globals from resol.m (changed calling sequence). Added texinfo header.

Removed trailing whitespace.
time-shift
Stéphane Adjemian (Scylla) 2011-09-17 12:33:07 +02:00
parent d81fd1b55b
commit 24cd423671
23 changed files with 326 additions and 284 deletions

View File

@ -136,7 +136,7 @@ for b=1:B
%deep = GetOneDraw(NumberOfDraws,FirstMhFile,LastMhFile,FirstLine,MAX_nruns,DirectoryName); %deep = GetOneDraw(NumberOfDraws,FirstMhFile,LastMhFile,FirstLine,MAX_nruns,DirectoryName);
[deep, logpo] = GetOneDraw(type); [deep, logpo] = GetOneDraw(type);
set_all_parameters(deep); set_all_parameters(deep);
dr = resol(oo_.steady_state,0); [dr,info,M_,options_,oo_] = resol(0,M_,options_,oo_);
[alphahat,etahat,epsilonhat,ahat,SteadyState,trend_coeff,aK] = ... [alphahat,etahat,epsilonhat,ahat,SteadyState,trend_coeff,aK] = ...
DsgeSmoother(deep,gend,Y,data_index); DsgeSmoother(deep,gend,Y,data_index);

View File

@ -150,7 +150,7 @@ while fpar<npar
end end
stock_param(irun2,:) = deep; stock_param(irun2,:) = deep;
set_parameters(deep); set_parameters(deep);
[dr,info] = resol(oo_.steady_state,0); [dr,info,M_,options_,oo_] = resol(0,M_,options_,oo_);
if info(1) if info(1)
nosaddle = nosaddle + 1; nosaddle = nosaddle + 1;
fpar = fpar - 1; fpar = fpar - 1;

View File

@ -103,7 +103,7 @@ for file = 1:NumberOfDrawsFiles
dr = pdraws{linee,2}; dr = pdraws{linee,2};
else else
set_parameters(pdraws{linee,1}); set_parameters(pdraws{linee,1});
[dr,info] = resol(oo_.steady_state,0); [dr,info,M_,options_,oo_] = resol(0,M_,options_,oo_);
end end
if first_call if first_call
endo_nbr = M_.endo_nbr; endo_nbr = M_.endo_nbr;

View File

@ -98,7 +98,7 @@ for file = 1:NumberOfDrawsFiles
dr = pdraws{linee,2}; dr = pdraws{linee,2};
else else
set_parameters(pdraws{linee,1}); set_parameters(pdraws{linee,1});
[dr,info] = resol(oo_.steady_state,0); [dr,info,M_,options_,oo_] = resol(0,M_,options_,oo_);
end end
tmp = th_autocovariances(dr,ivar,M_,options_,nodecomposition); tmp = th_autocovariances(dr,ivar,M_,options_,nodecomposition);
for i=1:nar for i=1:nar

View File

@ -98,7 +98,7 @@ for file = 1:NumberOfDrawsFiles
dr = pdraws{linee,2}; dr = pdraws{linee,2};
else else
set_parameters(pdraws{linee,1}); set_parameters(pdraws{linee,1});
[dr,info] = resol(oo_.steady_state,0); [dr,info,M_,options_,oo_] = resol(0,M_,options_,oo_);
end end
tmp = th_autocovariances(dr,ivar,M_,options_,nodecomposition); tmp = th_autocovariances(dr,ivar,M_,options_,nodecomposition);
for i=1:nvar for i=1:nvar

View File

@ -105,7 +105,7 @@ for file = 1:NumberOfDrawsFiles
dr = pdraws{linee,2}; dr = pdraws{linee,2};
else else
set_parameters(pdraws{linee,1}); set_parameters(pdraws{linee,1});
[dr,info] = resol(oo_.steady_state,0); [dr,info,M_,options_,oo_] = resol(0,M_,options_,oo_);
end end
tmp = th_autocovariances(dr,ivar,M_,options_,nodecomposition); tmp = th_autocovariances(dr,ivar,M_,options_,nodecomposition);
for i=1:nvar for i=1:nvar

View File

@ -38,9 +38,9 @@ function [A,B,ys,info] = dynare_resolve(mode)
% You should have received a copy of the GNU General Public License % You should have received a copy of the GNU General Public License
% along with Dynare. If not, see <http://www.gnu.org/licenses/>. % along with Dynare. If not, see <http://www.gnu.org/licenses/>.
global oo_ M_ global oo_ M_ oo_
[oo_.dr,info] = resol(oo_.steady_state,0); [oo_.dr,info,M_,options_,oo_] = resol(0,M_,options_,oo_);
if info(1) > 0 if info(1) > 0
A = []; A = [];

View File

@ -123,7 +123,7 @@ if isempty(load_data)
end end
oo_.steady_state = ys; oo_.steady_state = ys;
else% if the steady state file is not provided. else% if the steady state file is not provided.
[dd,info] = resol(oo_.steady_state,0); [dd,info,M_,options_,oo_] = resol(0,M_,options_,oo_);
oo_.steady_state = dd.ys; clear('dd'); oo_.steady_state = dd.ys; clear('dd');
end end
if all(abs(oo_.steady_state(bayestopt_.mfys))<1e-9) if all(abs(oo_.steady_state(bayestopt_.mfys))<1e-9)

View File

@ -129,7 +129,7 @@ if isempty(load_data)
end end
oo_.steady_state = ys; oo_.steady_state = ys;
else% if the steady state file is not provided. else% if the steady state file is not provided.
[dd,info] = resol(oo_.steady_state,0); [dd,info,M_,options_,oo_] = resol(0,M_,options_,oo_);
oo_.steady_state = dd.ys; clear('dd'); oo_.steady_state = dd.ys; clear('dd');
end end
if all(abs(oo_.steady_state(bayestopt_.mfys))<1e-9) if all(abs(oo_.steady_state(bayestopt_.mfys))<1e-9)

View File

@ -59,7 +59,7 @@ make_y_;
if init if init
oldopt = options_; oldopt = options_;
options_.order = 1; options_.order = 1;
[dr,info]=resol(oo_.steady_state,0); [dr,info,M_,options_,oo_] = resol(0,M_,options_,oo_);
oo_.dr = dr; oo_.dr = dr;
options_ = oldopt; options_ = oldopt;
if init==2 if init==2

View File

@ -71,7 +71,7 @@ for i=1:replic
params = rndprior(bayestopt_); params = rndprior(bayestopt_);
set_parameters(params); set_parameters(params);
% solve the model % solve the model
[dr,info] = resol(oo_.steady_state,0); [dr,info,M_,options_,oo_] = resol(0,M_,options_,oo_);
% discard problematic cases % discard problematic cases
if info if info
continue continue
@ -123,7 +123,7 @@ end
% compute shock uncertainty around forecast with mean prior % compute shock uncertainty around forecast with mean prior
set_parameters(bayestopt_.p1); set_parameters(bayestopt_.p1);
[dr,info] = resol(oo_.steady_state,0); [dr,info,M_,options_,oo_] = resol(0,M_,options_,oo_);
[yf3,yf3_intv] = forcst(dr,y0,periods,var_list); [yf3,yf3_intv] = forcst(dr,y0,periods,var_list);
yf3_1 = yf3'-[zeros(maximum_lag,n); yf3_intv]; yf3_1 = yf3'-[zeros(maximum_lag,n); yf3_intv];
yf3_2 = yf3'+[zeros(maximum_lag,n); yf3_intv]; yf3_2 = yf3'+[zeros(maximum_lag,n); yf3_intv];

View File

@ -98,7 +98,7 @@ for b=1:B
ib=ib+1; ib=ib+1;
deep = x(b,:)'; deep = x(b,:)';
set_all_parameters(deep); set_all_parameters(deep);
dr = resol(oo_.steady_state,0); [dr,info,M_,options_,oo_] = resol(0,M_,options_,oo_);
%deep(1:offset) = xparam1(1:offset); %deep(1:offset) = xparam1(1:offset);
logpo2(b,1) = DsgeLikelihood(deep,gend,data,data_index,number_of_observations,no_more_missing_observations); logpo2(b,1) = DsgeLikelihood(deep,gend,data,data_index,number_of_observations,no_more_missing_observations);
if opt_gsa.lik_only==0, if opt_gsa.lik_only==0,

View File

@ -539,7 +539,7 @@ if length(iunstable)>0 & length(iunstable)<Nsam,
x0 = [x0; lpmat(istable(1),:)']; x0 = [x0; lpmat(istable(1),:)'];
if istable(end)~=Nsam if istable(end)~=Nsam
M_.params(estim_params_.param_vals(:,1)) = lpmat(istable(1),:)'; M_.params(estim_params_.param_vals(:,1)) = lpmat(istable(1),:)';
[oo_.dr, info] = resol(oo_.steady_state,0); [oo_.dr,info,M_,options_,oo_] = resol(0,M_,options_,oo_);
% stoch_simul([]); % stoch_simul([]);
end end
else else

View File

@ -114,6 +114,6 @@ for i=1:np
end end
disp(sprintf('Objective function : %16.6g\n',f)); disp(sprintf('Objective function : %16.6g\n',f));
disp(' ') disp(' ')
oo_.dr=resol(oo_.steady_state,0); [oo_.dr,info,M_,options_,oo_] = resol(0,M_,options_,oo_);
% 05/10/03 MJ modified to work with osr.m and give full report % 05/10/03 MJ modified to work with osr.m and give full report

View File

@ -18,7 +18,7 @@ function [loss,vx,info]=osr_obj(x,i_params,i_var,weights);
% You should have received a copy of the GNU General Public License % You should have received a copy of the GNU General Public License
% along with Dynare. If not, see <http://www.gnu.org/licenses/>. % along with Dynare. If not, see <http://www.gnu.org/licenses/>.
global M_ oo_ optimal_Q_ it_ global M_ oo_ options_ optimal_Q_ it_
% global ys_ Sigma_e_ endo_nbr exo_nbr optimal_Q_ it_ ykmin_ options_ % global ys_ Sigma_e_ endo_nbr exo_nbr optimal_Q_ it_ ykmin_ options_
vx = []; vx = [];
@ -27,7 +27,7 @@ M_.params(i_params) = x;
% don't change below until the part where the loss function is computed % don't change below until the part where the loss function is computed
it_ = M_.maximum_lag+1; it_ = M_.maximum_lag+1;
[dr,info] = resol(oo_.steady_state,0); [dr,info,M_,options_,oo_] = resol(0,M_,options_,oo_);
switch info(1) switch info(1)
case 1 case 1

View File

@ -74,7 +74,7 @@ else
end end
if ~isstruct(compute_linear_solution) && compute_linear_solution if ~isstruct(compute_linear_solution) && compute_linear_solution
[dr,info]=resol(steady_state,0); [dr,info,M_,options_,oo_] = resol(0,M_,options_,oo_);
elseif isstruct(compute_linear_solution) elseif isstruct(compute_linear_solution)
dr = compute_linear_solution; dr = compute_linear_solution;
compute_linear_solution = 1; compute_linear_solution = 1;

View File

@ -162,7 +162,7 @@ for b=fpar:B
end end
end end
set_all_parameters(deep); set_all_parameters(deep);
[dr,info] = resol(oo_.steady_state,0); [dr,info,M_,options_,oo_] = resol(0,M_,options_,oo_);
if run_smoother if run_smoother
[alphahat,etahat,epsilonhat,alphatilde,SteadyState,trend_coeff,aK] = ... [alphahat,etahat,epsilonhat,alphatilde,SteadyState,trend_coeff,aK] = ...

View File

@ -80,7 +80,7 @@ while iteration < NumberOfSimulations
loop_indx = loop_indx+1; loop_indx = loop_indx+1;
params = prior_draw(); params = prior_draw();
set_all_parameters(params); set_all_parameters(params);
[dr,INFO] = resol(oo_.steady_state,work); [dr,INFO,M_,options_,oo_] = resol(work,M_,options_,oo_);
switch INFO(1) switch INFO(1)
case 0 case 0
file_line_number = file_line_number + 1 ; file_line_number = file_line_number + 1 ;

View File

@ -1,32 +1,80 @@
function [dr,info]=resol(steady_state_0,check_flag) function [dr,info,M,options,oo] = resol(check_flag,M,options,oo)
% function [dr,info]=resol(steady_state_0,check_flag)
% Computes first and second order approximations %@info:
% %! @deftypefn {Function File} {[@var{dr},@var{info},@var{M},@var{options},@var{oo}] =} resol (@var{check_flag},@var{M},@var{options},@var{oo})
% INPUTS %! @anchor{resol}
% steady_state_0: vector of variables in steady state %! @sp 1
% check_flag=0: all the approximation is computed %! Computes first and second order reduced form of the DSGE model.
% check_flag=1: computes only the eigenvalues %! @sp 2
% %! @strong{Inputs}
% OUTPUTS %! @sp 1
% dr: structure of decision rules for stochastic simulations %! @table @ @var
% info=1: the model doesn't determine the current variables '...' uniquely %! @item check_flag
% info=2: MJDGGES returns the following error code' %! Integer scalar, equal to 0 if all the approximation is required, positive if only the eigenvalues are to be computed.
% info=3: Blanchard Kahn conditions are not satisfied: no stable '...' equilibrium %! @item M
% info=4: Blanchard Kahn conditions are not satisfied:'...' indeterminacy %! Matlab's structure describing the model (initialized by @code{dynare}).
% info=5: Blanchard Kahn conditions are not satisfied:'...' indeterminacy due to rank failure %! @item options
% info=6: The jacobian evaluated at the steady state is complex. %! Matlab's structure describing the options (initialized by @code{dynare}).
% info=19: The steadystate file did not compute the steady state (inconsistent deep parameters). %! @item oo
% info=20: can't find steady state info(2) contains sum of sqare residuals %! Matlab's structure gathering the results (initialized by @code{dynare}).
% info=21: steady state is complex valued scalars %! @end table
% info(2) contains sum of square of %! @sp 2
% imaginary part of steady state %! @strong{Outputs}
% info=22: steady state has NaNs %! @sp 1
% info=23: M_.params has been updated in the steady state file and has complex valued scalars. %! @table @ @var
% info=24: M_.params has been updated in the steady state file and has some NaNs. %! @item dr
% info=30: Variance can't be computed %! Matlab's structure describing the reduced form solution of the model.
% %! @item info
% SPECIAL REQUIREMENTS %! Integer scalar, error code.
% none %! @sp 1
%! @table @ @code
%! @item info==0
%! No error.
%! @item info==1
%! The model doesn't determine the current variables uniquely.
%! @item info==2
%! MJDGGES returned an error code.
%! @item info==3
%! Blanchard & Kahn conditions are not satisfied: no stable equilibrium.
%! @item info==4
%! Blanchard & Kahn conditions are not satisfied: indeterminacy.
%! @item info==5
%! Blanchard & Kahn conditions are not satisfied: indeterminacy due to rank failure.
%! @item info==6
%! The jacobian evaluated at the deterministic steady state is complex.
%! @item info==19
%! The steadystate routine thrown an exception (inconsistent deep parameters).
%! @item info==20
%! Cannot find the steady state, info(2) contains the sum of square residuals (of the static equations).
%! @item info==21
%! The steady state is complex, info(2) contains the sum of square of imaginary parts of the steady state.
%! @item info==22
%! The steady has NaNs.
%! @item info==23
%! M_.params has been updated in the steadystate routine and has complex valued scalars.
%! @item info==24
%! M_.params has been updated in the steadystate routine and has some NaNs.
%! @item info==30
%! Ergodic variance can't be computed.
%! @end table
%! @sp 1
%! @item M
%! Matlab's structure describing the model (initialized by @code{dynare}).
%! @item options
%! Matlab's structure describing the options (initialized by @code{dynare}).
%! @item oo
%! Matlab's structure gathering the results (initialized by @code{dynare}).
%! @end table
%! @sp 2
%! @strong{This function is called by:}
%! @sp 1
%! @ref{dynare_estimation_init}
%! @sp 2
%! @strong{This function calls:}
%! @sp 1
%! None.
%! @end deftypefn
%@eod:
% Copyright (C) 2001-2011 Dynare Team % Copyright (C) 2001-2011 Dynare Team
% %
@ -45,94 +93,93 @@ function [dr,info]=resol(steady_state_0,check_flag)
% You should have received a copy of the GNU General Public License % You should have received a copy of the GNU General Public License
% along with Dynare. If not, see <http://www.gnu.org/licenses/>. % along with Dynare. If not, see <http://www.gnu.org/licenses/>.
global M_ options_ oo_
global it_ global it_
jacobian_flag = 0; jacobian_flag = 0;
if isfield(oo_,'dr'); if isfield(oo,'dr');
dr = oo_.dr; dr = oo.dr;
end end
options_ = set_default_option(options_,'jacobian_flag',1); options = set_default_option(options,'jacobian_flag',1);
info = 0; info = 0;
it_ = M_.maximum_lag + 1 ; it_ = M.maximum_lag + 1 ;
if M_.exo_nbr == 0 if M.exo_nbr == 0
oo_.exo_steady_state = [] ; oo.exo_steady_state = [] ;
end end
params0 = M_.params; params0 = M.params;
% check if steady_state_0 is steady state % check if steady_state_0 is steady state
tempex = oo_.exo_simul; tempex = oo.exo_simul;
oo_.exo_simul = repmat(oo_.exo_steady_state',M_.maximum_lag+M_.maximum_lead+1,1); oo.exo_simul = repmat(oo.exo_steady_state',M.maximum_lag+M.maximum_lead+1,1);
if M_.exo_det_nbr > 0 if M.exo_det_nbr > 0
tempexdet = oo_.exo_det_simul; tempexdet = oo.exo_det_simul;
oo_.exo_det_simul = repmat(oo_.exo_det_steady_state',M_.maximum_lag+M_.maximum_lead+1,1); oo.exo_det_simul = repmat(oo.exo_det_steady_state',M.maximum_lag+M.maximum_lead+1,1);
end end
steady_state = steady_state_0; steady_state = steady_state_0;
check1 = 0; check1 = 0;
% testing for steadystate file % testing for steadystate file
if (~options_.bytecode) if (~options.bytecode)
fh = str2func([M_.fname '_static']); fh = str2func([M.fname '_static']);
end end
if options_.steadystate_flag if options.steadystate_flag
[steady_state,check1] = feval([M_.fname '_steadystate'],steady_state,... [steady_state,check1] = feval([M.fname '_steadystate'],steady_state,...
[oo_.exo_steady_state; ... [oo.exo_steady_state; ...
oo_.exo_det_steady_state]); oo.exo_det_steady_state]);
if size(steady_state,1) < M_.endo_nbr if size(steady_state,1) < M.endo_nbr
if length(M_.aux_vars) > 0 if length(M.aux_vars) > 0
steady_state = add_auxiliary_variables_to_steadystate(steady_state,M_.aux_vars,... steady_state = add_auxiliary_variables_to_steadystate(steady_state,M.aux_vars,...
M_.fname,... M.fname,...
oo_.exo_steady_state,... oo.exo_steady_state,...
oo_.exo_det_steady_state,... oo.exo_det_steady_state,...
M_.params,... M.params,...
options_.bytecode); options.bytecode);
else else
error([M_.fname '_steadystate.m doesn''t match the model']); error([M.fname '_steadystate.m doesn''t match the model']);
end end
end end
else else
% testing if steady_state_0 isn't a steady state or if we aren't computing Ramsey policy % testing if steady_state_0 isn't a steady state or if we aren't computing Ramsey policy
if options_.ramsey_policy == 0 if options.ramsey_policy == 0
if options_.linear == 0 if options.linear == 0
% nonlinear models % nonlinear models
if (options_.block == 0 && options_.bytecode == 0) if (options.block == 0 && options.bytecode == 0)
if max(abs(feval(fh,steady_state,[oo_.exo_steady_state; ... if max(abs(feval(fh,steady_state,[oo.exo_steady_state; ...
oo_.exo_det_steady_state], M_.params))) > options_.dynatol oo.exo_det_steady_state], M.params))) > options.dynatol
[steady_state,check1] = dynare_solve(fh,steady_state,options_.jacobian_flag,... [steady_state,check1] = dynare_solve(fh,steady_state,options.jacobian_flag,...
[oo_.exo_steady_state; ... [oo.exo_steady_state; ...
oo_.exo_det_steady_state], M_.params); oo.exo_det_steady_state], M.params);
end end
else else
[steady_state,check1] = dynare_solve_block_or_bytecode(steady_state,... [steady_state,check1] = dynare_solve_block_or_bytecode(steady_state,...
[oo_.exo_steady_state; ... [oo.exo_steady_state; ...
oo_.exo_det_steady_state], M_.params); oo.exo_det_steady_state], M.params);
end; end;
else else
if (options_.block == 0 && options_.bytecode == 0) if (options.block == 0 && options.bytecode == 0)
% linear models % linear models
[fvec,jacob] = feval(fh,steady_state,[oo_.exo_steady_state;... [fvec,jacob] = feval(fh,steady_state,[oo.exo_steady_state;...
oo_.exo_det_steady_state], M_.params); oo.exo_det_steady_state], M.params);
if max(abs(fvec)) > 1e-12 if max(abs(fvec)) > 1e-12
steady_state = steady_state-jacob\fvec; steady_state = steady_state-jacob\fvec;
end end
else else
[steady_state,check1] = dynare_solve_block_or_bytecode(steady_state,... [steady_state,check1] = dynare_solve_block_or_bytecode(steady_state,...
[oo_.exo_steady_state; ... [oo.exo_steady_state; ...
oo_.exo_det_steady_state], M_.params); oo.exo_det_steady_state], M.params);
end; end;
end end
end end
end end
% test if M_.params_has changed. % test if M.params_has changed.
if options_.steadystate_flag if options.steadystate_flag
updated_params_flag = max(abs(M_.params-params0))>1e-12; updated_params_flag = max(abs(M.params-params0))>1e-12;
else else
updated_params_flag = 0; updated_params_flag = 0;
end end
@ -141,12 +188,12 @@ end
dr.ys = steady_state; dr.ys = steady_state;
if check1 if check1
if options_.steadystate_flag if options.steadystate_flag
info(1)= 19; info(1)= 19;
resid = check1 ; resid = check1 ;
else else
info(1)= 20; info(1)= 20;
resid = feval(fh,steady_state_0,oo_.exo_steady_state, M_.params); resid = feval(fh,steady_state_0,oo.exo_steady_state, M.params);
end end
info(2) = resid'*resid ; info(2) = resid'*resid ;
return return
@ -167,14 +214,14 @@ if ~isempty(find(isnan(steady_state)))
return return
end end
if options_.steadystate_flag && updated_params_flag && ~isreal(M_.params) if options.steadystate_flag && updated_params_flag && ~isreal(M.params)
info(1) = 23; info(1) = 23;
info(2) = sum(imag(M_.params).^2); info(2) = sum(imag(M.params).^2);
dr.ys = steady_state; dr.ys = steady_state;
return return
end end
if options_.steadystate_flag && updated_params_flag && ~isempty(find(isnan(M_.params))) if options.steadystate_flag && updated_params_flag && ~isempty(find(isnan(M.params)))
info(1) = 24; info(1) = 24;
info(2) = NaN; info(2) = NaN;
dr.ys = steady_state; dr.ys = steady_state;
@ -182,22 +229,17 @@ if options_.steadystate_flag && updated_params_flag && ~isempty(find(isnan(M_.p
end end
if options_.block if options.block
[dr,info,M_,options_,oo_] = dr_block(dr,check_flag,M_,options_,oo_); [dr,info,M,options,oo] = dr_block(dr,check_flag,M,options,oo);
else else
[dr,info,M_,options_,oo_] = dr1(dr,check_flag,M_,options_,oo_); [dr,info,M,options,oo] = dr1(dr,check_flag,M,options,oo);
end end
if info(1) if info(1)
return return
end end
if M_.exo_det_nbr > 0 if M.exo_det_nbr > 0
oo_.exo_det_simul = tempexdet; oo.exo_det_simul = tempexdet;
end end
oo_.exo_simul = tempex; oo.exo_simul = tempex;
tempex = []; tempex = [];
% 01/01/2003 MJ added dr_algo == 1
% 08/24/2001 MJ uses Schmitt-Grohe and Uribe (2001) constant correction
% in dr.ghs2
% 05/26/2003 MJ added temporary values for oo_.exo_simul

View File

@ -48,7 +48,7 @@ steady_;
% Compute the first order perturbation reduced form. % Compute the first order perturbation reduced form.
old_options_order = options_.order; options_.order = 1; old_options_order = options_.order; options_.order = 1;
[oo_.dr,info] = resol(oo_.steady_state,0); [oo_.dr,info,M_,options_,oo_] = resol(0,M_,options_,oo_);
options_.order = old_options_order; options_.order = old_options_order;
% Set various options. % Set various options.

View File

@ -111,7 +111,7 @@ if info
pdraws(i,1) = {x2(SampleAddress(i,4),:)}; pdraws(i,1) = {x2(SampleAddress(i,4),:)};
if info-1 if info-1
set_parameters(pdraws{i,1}); set_parameters(pdraws{i,1});
[dr,info] = resol(oo_.steady_state,0); [dr,info,M_,options_,oo_] = resol(0,M_,options_,oo_);
pdraws(i,2) = { dr }; pdraws(i,2) = { dr };
end end
old_mhfile = mhfile; old_mhfile = mhfile;
@ -138,7 +138,7 @@ if info
pdraws(linee,1) = {x2(SampleAddress(i,4),:)}; pdraws(linee,1) = {x2(SampleAddress(i,4),:)};
if info-1 if info-1
set_parameters(pdraws{linee,1}); set_parameters(pdraws{linee,1});
[dr,info] = resol(oo_.steady_state,0); [dr,info,M_,options_,oo_] = resol(0,M_,options_,oo_);
pdraws(linee,2) = { dr }; pdraws(linee,2) = { dr };
end end
old_mhfile = mhfile; old_mhfile = mhfile;

View File

@ -69,7 +69,7 @@ elseif options_.discretionary_policy
end end
[oo_.dr,ys,info] = discretionary_policy_1(oo_,options_.instruments); [oo_.dr,ys,info] = discretionary_policy_1(oo_,options_.instruments);
else else
[oo_.dr, info] = resol(oo_.steady_state,0); [oo_.dr,info,M_,options_,oo_] = resol(0,M_,options_,oo_);
end end
if info(1) if info(1)

View File

@ -38,7 +38,7 @@ end
check_model; check_model;
[oo_.dr, info] = resol(oo_.steady_state,0); [oo_.dr,info,M_,options_,oo_] = resol(0,M_,options_,oo_);
if info(1) if info(1)
options_ = options_old; options_ = options_old;