diff --git a/matlab/+mom/run.m b/matlab/+mom/run.m index 3e562030802f5d236f9f3a3922544038124a291b..897c0aa772e77fd35095967d7ef604419c012db3 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 457b6ee4dda72c8c93f49155da24842603fc8c8d..6e20df0b0fe51f4be36eaa5f6e9661511b43d13a 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 a7c7f7822688f9af9d0874009e55c22538ae926e..7ef9562ed60a711e703cf1fbb3b1835ae1b14601 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 06e5e15a3492441449089b6c45a87c35983d1d99..b2559cc0f0123655740abcec47444cf71590aa63 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 fee2055ad0a4030f27af472258cf3e97fece980c..18d96c7175f98483b8cbef4f33038d557b70e03a 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 7c9d22ed5b443f1d1e4e11ca5a1fffac1315ed14..d1518c891f1ff2bf5262b38c9b37b9c5295ae830 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 4417f7b5adbd776a04342ede7f4f65ad18170c74..49cf971cd3c3d3d51867021d4d311772c0132fc6 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 748495701c40fbfdbe5fa9ae44b90cbd6d5228b1..cd03c734f739ec40bddd31776febeeb00b8164b6 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 <https://www.gnu.org/licenses/>. % 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 387f7fe8d19e49b2f33eb29907e12f3341768639..dc62187cfbddc7203a48476f133a051b4b729f2e 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 dd73cfb3efe7fe5e213ca7ded295e2421b577baf..1c7ced5c968ef8302faeebb4d26d5162b089a6e3 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 23ffe5f3750ae838e3087061b320ee2ae426b95a..172190ce716fbc363cfb2c4a0b7b27304d7f2130 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 e442a2c16e3fe3ebf0f2d680cca8c0ed11dfa3df..5e5de1da4ad5f14ed773b304b98154376f15bb5b 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 <https://www.gnu.org/licenses/>. -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 63a0dcefe9ae5db378b73603ef4eb2140daf55d8..1b4ce0918d5486c4ef6ddcfb43afe80d22a5edf5 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 a43220abcea17af970e9f3e28ad234cb53bf51b5..caf4aba0706802bc009d36585f8c17c63185359e 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 3234681f7d96ec5bf64914d3b94c662a1ff2ffae..7eb01dc889ea278ad6bf4f0add43cc6391d071d2 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 084372a314a5f3081dc055ba83dd879947809576..16b063f666df679173e3da7f30ec1bff55755ddb 160000 --- a/preprocessor +++ b/preprocessor @@ -1 +1 @@ -Subproject commit 084372a314a5f3081dc055ba83dd879947809576 +Subproject commit 16b063f666df679173e3da7f30ec1bff55755ddb