diff --git a/matlab/+mom/run.m b/matlab/+mom/run.m index 3e5620308..897c0aa77 100644 --- a/matlab/+mom/run.m +++ b/matlab/+mom/run.m @@ -249,7 +249,7 @@ CheckPath('graphs',options_mom_.dirname); options_mom_.mom.compute_derivs = false; % flag to compute derivs in objective function (might change for GMM with either analytic_standard_errors or analytic_jacobian (dependent on optimizer)) options_mom_.mom.vector_output = false; % specifies whether the objective function returns a vector % decision rule -oo_.dr = set_state_space(oo_.dr,M_,options_mom_); % get state-space representation +oo_.dr = set_state_space(oo_.dr,M_); % get state-space representation oo_.mom.obs_var = []; % create index of observed variables in DR order for i = 1:options_mom_.obs_nbr oo_.mom.obs_var = [oo_.mom.obs_var; find(strcmp(options_mom_.varobs{i}, M_.endo_names(oo_.dr.order_var)))]; diff --git a/matlab/+osr/run.m b/matlab/+osr/run.m index 457b6ee4d..6e20df0b0 100644 --- a/matlab/+osr/run.m +++ b/matlab/+osr/run.m @@ -105,7 +105,7 @@ if isfield(options_.osr,'maxit') || isfield(options_.osr,'tolf') end end -oo_.dr = set_state_space(oo_.dr,M_,options_); +oo_.dr = set_state_space(oo_.dr,M_); par_0 = M_.params(i_params); inv_order_var = oo_.dr.inv_order_var; diff --git a/matlab/check.m b/matlab/check.m index a7c7f7822..7ef9562ed 100644 --- a/matlab/check.m +++ b/matlab/check.m @@ -40,7 +40,7 @@ if isempty(options_.qz_criterium) options_.qz_criterium = 1+1e-6; end -oo_.dr=set_state_space(oo_.dr,M_,options_); +oo_.dr=set_state_space(oo_.dr,M_); [dr,info] = resol(1,M_,options_,oo_.dr ,oo_.steady_state, oo_.exo_steady_state, oo_.exo_det_steady_state); diff --git a/matlab/cli/prior.m b/matlab/cli/prior.m index 06e5e15a3..b2559cc0f 100644 --- a/matlab/cli/prior.m +++ b/matlab/cli/prior.m @@ -135,7 +135,7 @@ if ismember('moments', varargin) % Prior simulations (2nd order moments). check_model(Model); % Compute state space representation of the model. oo__ = oo_; - oo__.dr = set_state_space(oo__.dr, Model, options_); + oo__.dr = set_state_space(oo__.dr, Model); % Solve model [T,R,~,info,oo__.dr, Model.params] = dynare_resolve(Model , options_ , oo__.dr, oo__.steady_state, oo__.exo_steady_state, oo__.exo_det_steady_state,'restrict'); if ~info(1) diff --git a/matlab/discretionary_policy/discretionary_policy_1.m b/matlab/discretionary_policy/discretionary_policy_1.m index fee2055ad..18d96c717 100644 --- a/matlab/discretionary_policy/discretionary_policy_1.m +++ b/matlab/discretionary_policy/discretionary_policy_1.m @@ -116,7 +116,7 @@ end %write back solution to dr dr.ys =ys; -dr=set_state_space(dr,M_,options_); +dr=set_state_space(dr,M_); T=H(dr.order_var,dr.order_var); dr.ghu=G(dr.order_var,:); if M_.maximum_endo_lag diff --git a/matlab/dynare_estimation_init.m b/matlab/dynare_estimation_init.m index 7c9d22ed5..d1518c891 100644 --- a/matlab/dynare_estimation_init.m +++ b/matlab/dynare_estimation_init.m @@ -268,7 +268,7 @@ else% Yes! end % Get informations about the variables of the model. -dr = set_state_space(oo_.dr,M_,options_); +dr = set_state_space(oo_.dr,M_); oo_.dr = dr; nstatic = M_.nstatic; % Number of static variables. npred = M_.nspred; % Number of predetermined variables. diff --git a/matlab/ep/extended_path_initialization.m b/matlab/ep/extended_path_initialization.m index 4417f7b5a..49cf971cd 100644 --- a/matlab/ep/extended_path_initialization.m +++ b/matlab/ep/extended_path_initialization.m @@ -77,7 +77,7 @@ DynareOptions.stack_solve_algo = ep.stack_solve_algo; dr = struct(); if ep.init DynareOptions.order = 1; - DynareResults.dr=set_state_space(dr,DynareModel,DynareOptions); + DynareResults.dr=set_state_space(dr,DynareModel); [DynareResults.dr,Info,DynareModel.params] = resol(0,DynareModel,DynareOptions,DynareResults.dr,DynareResults.steady_state, DynareResults.exo_steady_state, DynareResults.exo_det_steady_state); end @@ -103,7 +103,7 @@ end % hybrid correction pfm.hybrid_order = ep.stochastic.hybrid_order; if pfm.hybrid_order - DynareResults.dr = set_state_space(DynareResults.dr, DynareModel, DynareOptions); + DynareResults.dr = set_state_space(DynareResults.dr, DynareModel); options = DynareOptions; options.order = pfm.hybrid_order; [pfm.dr, DynareModel.params] = resol(0, DynareModel, options, DynareResults.dr, DynareResults.steady_state, DynareResults.exo_steady_state, DynareResults.exo_det_steady_state); diff --git a/matlab/optimize_prior.m b/matlab/optimize_prior.m index 748495701..cd03c734f 100644 --- a/matlab/optimize_prior.m +++ b/matlab/optimize_prior.m @@ -20,7 +20,7 @@ function optimize_prior(DynareOptions, ModelInfo, DynareResults, BayesInfo, Esti % along with Dynare. If not, see . % Initialize to the prior mean -DynareResults.dr = set_state_space(DynareResults.dr,ModelInfo,DynareOptions); +DynareResults.dr = set_state_space(DynareResults.dr,ModelInfo); xparam1 = BayesInfo.p1; % Pertubation of the initial condition. diff --git a/matlab/partial_information/dr1_PI.m b/matlab/partial_information/dr1_PI.m index 387f7fe8d..dc62187cf 100644 --- a/matlab/partial_information/dr1_PI.m +++ b/matlab/partial_information/dr1_PI.m @@ -157,7 +157,7 @@ if options_.debug save([M_.dname filesep 'Output' filesep M_.fname '_debug.mat'],'jacobia_') end -dr=set_state_space(dr,M_,options_); +dr=set_state_space(dr,M_); kstate = dr.kstate; nstatic = M_.nstatic; nfwrd = M_.nfwrd; diff --git a/matlab/perfect-foresight-models/det_cond_forecast.m b/matlab/perfect-foresight-models/det_cond_forecast.m index dd73cfb3e..1c7ced5c9 100644 --- a/matlab/perfect-foresight-models/det_cond_forecast.m +++ b/matlab/perfect-foresight-models/det_cond_forecast.m @@ -45,7 +45,7 @@ end if ~isfield(oo_,'dr') || ~isfield(oo_.dr,'ghx') fprintf('computing the first order solution of the model as initial guess...'); dr = struct(); - oo_.dr=set_state_space(dr,M_,options_); + oo_.dr=set_state_space(dr,M_); options_.order = 1; [oo_.dr,Info,M_.params] = resol(0,M_,options_,oo_.dr ,oo_.steady_state, oo_.exo_steady_state, oo_.exo_det_steady_state); fprintf('done\n'); diff --git a/matlab/prior_sampler.m b/matlab/prior_sampler.m index 23ffe5f37..172190ce7 100644 --- a/matlab/prior_sampler.m +++ b/matlab/prior_sampler.m @@ -83,7 +83,7 @@ sampled_prior_covariance = zeros(NumberOfParameters,NumberOfParameters); file_line_number = 0; file_indx_number = 0; -oo_.dr=set_state_space(oo_.dr,M_,options_); +oo_.dr=set_state_space(oo_.dr,M_); hh_fig = dyn_waitbar(0,'Please wait. Prior sampler...'); set(hh_fig,'Name','Prior sampler.'); diff --git a/matlab/set_state_space.m b/matlab/set_state_space.m index e442a2c16..5e5de1da4 100644 --- a/matlab/set_state_space.m +++ b/matlab/set_state_space.m @@ -1,8 +1,9 @@ -function dr=set_state_space(dr,DynareModel,DynareOptions) +function dr=set_state_space(dr,M_) +% dr=set_state_space(dr,M_) % Write the state space representation of the reduced form solution. %@info: -%! @deftypefn {Function File} {[@var{dr} =} set_state_space (@var{dr},@var{DynareModel},@var{DynareOptions}) +%! @deftypefn {Function File} {[@var{dr} =} set_state_space (@var{dr},@var{M_}) %! @anchor{set_state_space} %! @sp 1 %! Write the state space representation of the reduced form solution. @@ -12,10 +13,8 @@ function dr=set_state_space(dr,DynareModel,DynareOptions) %! @table @ @var %! @item dr %! Matlab's structure describing decision and transition rules. -%! @item DynareModel +%! @item M_ %! Matlab's structure describing the model (initialized by dynare, see @ref{M_}) -%! @item DynareOptions -%! Matlab's structure describing the current options (initialized by dynare, see @ref{options_}). %! @end table %! @sp 2 %! @strong{Outputs} @@ -51,10 +50,10 @@ function dr=set_state_space(dr,DynareModel,DynareOptions) % You should have received a copy of the GNU General Public License % along with Dynare. If not, see . -max_lead = DynareModel.maximum_endo_lead; -max_lag = DynareModel.maximum_endo_lag; -endo_nbr = DynareModel.endo_nbr; -lead_lag_incidence = DynareModel.lead_lag_incidence; +max_lead = M_.maximum_endo_lead; +max_lag = M_.maximum_endo_lag; +endo_nbr = M_.endo_nbr; +lead_lag_incidence = M_.lead_lag_incidence; klen = max_lag + max_lead + 1; fwrd_var = find(lead_lag_incidence(max_lag+2:end,:))'; diff --git a/matlab/simulated_moment_uncertainty.m b/matlab/simulated_moment_uncertainty.m index 63a0dcefe..1b4ce0918 100644 --- a/matlab/simulated_moment_uncertainty.m +++ b/matlab/simulated_moment_uncertainty.m @@ -58,7 +58,7 @@ if M_.exo_nbr > 0 oo_.exo_simul= ones(max(options_.periods,1) + M_.maximum_lag + M_.maximum_lead,1) * oo_.exo_steady_state'; end -oo_.dr=set_state_space(oo_.dr,M_,options_); +oo_.dr=set_state_space(oo_.dr,M_); if options_.logged_steady_state %if steady state was previously logged, undo this diff --git a/matlab/stoch_simul.m b/matlab/stoch_simul.m index a43220abc..caf4aba07 100644 --- a/matlab/stoch_simul.m +++ b/matlab/stoch_simul.m @@ -103,7 +103,7 @@ end check_model(M_); -oo_.dr=set_state_space(oo_.dr,M_,options_); +oo_.dr=set_state_space(oo_.dr,M_); if PI_PCL_solver [oo_.dr, info] = PCL_resol(oo_.steady_state,0); diff --git a/matlab/stochastic_solvers.m b/matlab/stochastic_solvers.m index 3234681f7..7eb01dc88 100644 --- a/matlab/stochastic_solvers.m +++ b/matlab/stochastic_solvers.m @@ -87,7 +87,7 @@ end if options_.k_order_solver orig_order = options_.order; options_.order = local_order; - dr = set_state_space(dr,M_,options_); + dr = set_state_space(dr,M_); [dr,info] = k_order_pert(dr,M_,options_); options_.order = orig_order; return diff --git a/preprocessor b/preprocessor index 084372a31..16b063f66 160000 --- a/preprocessor +++ b/preprocessor @@ -1 +1 @@ -Subproject commit 084372a314a5f3081dc055ba83dd879947809576 +Subproject commit 16b063f666df679173e3da7f30ec1bff55755ddb