diff --git a/matlab/+mom/run.m b/matlab/+mom/run.m index ccbb4bb3d..720006edb 100644 --- a/matlab/+mom/run.m +++ b/matlab/+mom/run.m @@ -62,8 +62,8 @@ function [oo_, options_mom_, M_] = run(bayestopt_, options_, oo_, estim_params_, % o set_state_space.m % o set_all_parameters.m % o test_for_deep_parameters_calibration.m -% ========================================================================= -% Copyright © 2020-2022 Dynare Team + +% Copyright © 2020-2023 Dynare Team % % This file is part of Dynare. % @@ -688,7 +688,7 @@ end old_steady_params=M_.params; %save initial parameters for check if steady state changes param values % Check steady state at initial model parameter values -[oo_.steady_state, new_steady_params, info] = evaluate_steady_state(oo_.steady_state,M_,options_mom_,oo_,steadystate_check_flag); +[oo_.steady_state, new_steady_params, info] = evaluate_steady_state(oo_.steady_state,[oo_.exo_steady_state; oo_.exo_det_steady_state],M_,options_mom_,steadystate_check_flag); if info(1) fprintf('\nmethod_of_moments: The steady state at the initial parameters cannot be computed.\n') print_info(info, 0, options_mom_); @@ -699,7 +699,7 @@ if isfield(estim_params_,'param_vals') && ~isempty(estim_params_.param_vals) Model_par_varied=M_; %store M_ structure Model_par_varied.params(estim_params_.param_vals(:,1))=Model_par_varied.params(estim_params_.param_vals(:,1))*1.01; %vary parameters - [~, new_steady_params_2] = evaluate_steady_state(oo_.steady_state,Model_par_varied,options_mom_,oo_,1); + [~, new_steady_params_2] = evaluate_steady_state(oo_.steady_state,[oo_.exo_steady_state; oo_.exo_det_steady_state],Model_par_varied,options_mom_,true); changed_par_indices=find((old_steady_params(estim_params_.param_vals(:,1))-new_steady_params(estim_params_.param_vals(:,1))) ... | (Model_par_varied.params(estim_params_.param_vals(:,1))-new_steady_params_2(estim_params_.param_vals(:,1)))); diff --git a/matlab/accessors/get_mean.m b/matlab/accessors/get_mean.m index 9311bd4a2..3c54cb98a 100644 --- a/matlab/accessors/get_mean.m +++ b/matlab/accessors/get_mean.m @@ -13,7 +13,7 @@ function y0 = get_mean(varargin) % SPECIAL REQUIREMENTS % none -% Copyright © 2019 Dynare Team +% Copyright © 2019-2023 Dynare Team % % This file is part of Dynare. % @@ -39,7 +39,7 @@ else end if order==1 ys_ = oo_.steady_state; - ys_ = evaluate_steady_state(ys_,M_,options_,oo_,1); + ys_ = evaluate_steady_state(ys_,[oo_.exo_steady_state; oo_.exo_det_steady_state],M_,options_,true); elseif order==2 ys_ = oo_.dr.ys; ys_(oo_.dr.order_var)=ys_(oo_.dr.order_var)+oo_.dr.ghs2./2; diff --git a/matlab/dyn_ramsey_static.m b/matlab/dyn_ramsey_static.m index 33d4d5804..9409b3ae9 100644 --- a/matlab/dyn_ramsey_static.m +++ b/matlab/dyn_ramsey_static.m @@ -1,4 +1,4 @@ -function [steady_state, params, check] = dyn_ramsey_static(ys_init, M, options_, oo) +function [steady_state, params, check] = dyn_ramsey_static(ys_init, exo_ss, M, options_) % Computes the steady state for optimal policy % @@ -12,9 +12,9 @@ function [steady_state, params, check] = dyn_ramsey_static(ys_init, M, options_, % INPUTS % ys_init: vector of endogenous variables or instruments +% exo_ss vector of exogenous steady state (incl. deterministic exogenous) % M: Dynare model structure % options: Dynare options structure -% oo: Dynare results structure % % OUTPUTS % steady_state: steady state value @@ -46,10 +46,9 @@ function [steady_state, params, check] = dyn_ramsey_static(ys_init, M, options_, params = M.params; check = 0; options_.steadystate.nocheck = 1; %locally disable checking because Lagrange multipliers are not accounted for in evaluate_steady_state_file -nl_func = @(x) dyn_ramsey_static_1(x,M,options_,oo); -exo_ss = [oo.exo_steady_state oo.exo_det_steady_state]; +nl_func = @(x) dyn_ramsey_static_1(x,exo_ss,ys_init,M,options_); -if ~options_.steadystate_flag && check_static_model(ys_init,M,options_,oo) +if ~options_.steadystate_flag && check_static_model(ys_init,exo_ss,M,options_) steady_state = ys_init; return elseif options_.steadystate_flag @@ -82,7 +81,7 @@ elseif options_.steadystate_flag [xx,params] = evaluate_steady_state_file(ys_init,exo_ss,M,options_,~options_.steadystate.nocheck); %run steady state file again to update parameters [~,~,steady_state] = nl_func(inst_val); %compute and return steady state else - xx = oo.steady_state(1:M.orig_endo_nbr); + xx = ys_init(1:M.orig_endo_nbr); o_jacobian_flag = options_.jacobian_flag; options_.jacobian_flag = false; [xx, errorflag] = dynare_solve(nl_func, xx, options_.ramsey.maxit, options_.solve_tolf, options_.solve_tolx, options_); @@ -94,21 +93,18 @@ else end -function [resids,rJ,steady_state] = dyn_ramsey_static_1(x,M,options_,oo) +function [resids,rJ,steady_state] = dyn_ramsey_static_1(x,exo_ss,ys_init,M,options_) resids = []; rJ = []; mult = []; inst_nbr = M.ramsey_orig_endo_nbr - M.ramsey_orig_eq_nbr; -exo_ss = [oo.exo_steady_state oo.exo_det_steady_state]; - if options_.steadystate_flag k_inst = []; for i = 1:size(options_.instruments,1) k_inst = [k_inst; strmatch(options_.instruments{i}, M.endo_names, 'exact')]; end - ys_init=zeros(size(oo.steady_state)); %create starting vector for steady state computation as only instrument value is handed over ys_init(k_inst) = x; %set instrument, the only value required for steady state computation, to current value [x,M.params,check] = evaluate_steady_state_file(ys_init,... %returned x now has size endo_nbr as opposed to input size of n_instruments exo_ss, ... @@ -168,9 +164,8 @@ else steady_state = [xx(1:M.ramsey_orig_endo_nbr); mult]; end -function result = check_static_model(ys,M,options_,oo) +function result = check_static_model(ys,exo_ss,M,options_) result = false; -exo_ss = [oo.exo_steady_state oo.exo_det_steady_state]; if (options_.bytecode) [res, ~] = bytecode('static', ys, exo_ss, M.params, 'evaluate'); else diff --git a/matlab/dynare_estimation_init.m b/matlab/dynare_estimation_init.m index f17b9937f..202573421 100644 --- a/matlab/dynare_estimation_init.m +++ b/matlab/dynare_estimation_init.m @@ -488,7 +488,7 @@ if options_.analytic_derivation else steadystate_check_flag = 1; end - [tmp1, params] = evaluate_steady_state(oo_.steady_state,M,options_,oo_,steadystate_check_flag); + [tmp1, params] = evaluate_steady_state(oo_.steady_state,[oo_.exo_steady_state; oo_.exo_det_steady_state],M,options_,steadystate_check_flag); change_flag=any(find(params-M.params)); if change_flag skipline() @@ -561,7 +561,7 @@ ncn = estim_params_.ncn; if estim_params_.np M.params(estim_params_.param_vals(:,1)) = xparam1(nvx+ncx+nvn+ncn+1:end); end -[oo_.steady_state, params,info] = evaluate_steady_state(oo_.steady_state,M,options_,oo_,steadystate_check_flag); +[oo_.steady_state, params,info] = evaluate_steady_state(oo_.steady_state,[oo_.exo_steady_state; oo_.exo_det_steady_state],M,options_,steadystate_check_flag); if info(1) fprintf('\ndynare_estimation_init:: The steady state at the initial parameters cannot be computed.\n') @@ -696,4 +696,4 @@ if options_.occbin.smoother.status || options_.occbin.likelihood.status options_.occbin.simul.exo_pos=1:M_.exo_nbr; M_.surprise_shocks=[]; end -end \ No newline at end of file +end diff --git a/matlab/evaluate_steady_state.m b/matlab/evaluate_steady_state.m index dd3a368fe..c24ea573a 100644 --- a/matlab/evaluate_steady_state.m +++ b/matlab/evaluate_steady_state.m @@ -1,13 +1,13 @@ -function [ys,params,info] = evaluate_steady_state(ys_init,M,options,oo,steadystate_check_flag) -% function [ys,params,info] = evaluate_steady_state(ys_init,M,options,oo,steadystate_check_flag) +function [ys,params,info] = evaluate_steady_state(ys_init,exo_ss,M,options,steadystate_check_flag) +% function [ys,params,info] = evaluate_steady_state(ys_init,exo_ss,M,options,steadystate_check_flag) % Computes the steady state % % INPUTS % ys_init vector initial values used to compute the steady % state +% exo_ss vector exogenous steady state (incl. deterministic exogenous) % M struct model structure % options struct options -% oo struct output results % steadystate_check_flag boolean if true, check that the % steadystate verifies the % static model @@ -61,7 +61,6 @@ check = 0; steadystate_flag = options.steadystate_flag; params = M.params; -exo_ss = [oo.exo_steady_state; oo.exo_det_steady_state]; if length(M.aux_vars) > 0 && ~steadystate_flag && M.set_auxiliary_variables h_set_auxiliary_variables = str2func([M.fname '.set_auxiliary_variables']); @@ -192,7 +191,7 @@ if options.ramsey_policy end %either if no steady state file or steady state file without problems - [ys,params,info] = dyn_ramsey_static(ys_init,M,options,oo); + [ys,params,info] = dyn_ramsey_static(ys_init,exo_ss,M,options); if info return end diff --git a/matlab/evaluate_steady_state_file.m b/matlab/evaluate_steady_state_file.m index 485971ee7..4b6bfdc70 100644 --- a/matlab/evaluate_steady_state_file.m +++ b/matlab/evaluate_steady_state_file.m @@ -5,7 +5,7 @@ function [ys,params,info] = evaluate_steady_state_file(ys_init,exo_ss,M,options, % INPUTS % ys_init vector initial values used to compute the steady % state -% exo_ss vector exogenous steady state +% exo_ss vector exogenous steady state (incl. deterministic exogenous) % M struct model parameters % options struct options % steady_state_checkflag boolean indicator whether to check steady state returned diff --git a/matlab/gsa/filt_mc_.m b/matlab/gsa/filt_mc_.m index 93d112825..02549596c 100644 --- a/matlab/gsa/filt_mc_.m +++ b/matlab/gsa/filt_mc_.m @@ -14,7 +14,7 @@ function [rmse_MC, ixx] = filt_mc_(OutDir,options_gsa_,dataset_,dataset_info) % marco.ratto@ec.europa.eu % Copyright © 2012-2016 European Commission -% Copyright © 2012-2022 Dynare Team +% Copyright © 2012-2023 Dynare Team % % This file is part of Dynare. % @@ -126,11 +126,11 @@ end if ~loadSA if exist('xparam1','var') M_ = set_all_parameters(xparam1,estim_params_,M_); - ys_mode=evaluate_steady_state(oo_.steady_state,M_,options_,oo_,~options_.steadystate.nocheck); + ys_mode=evaluate_steady_state(oo_.steady_state,[oo_.exo_steady_state; oo_.exo_det_steady_state],M_,options_,~options_.steadystate.nocheck); end if exist('xparam1_mean','var') M_ = set_all_parameters(xparam1_mean,estim_params_,M_); - ys_mean=evaluate_steady_state(oo_.steady_state,M_,options_,oo_,~options_.steadystate.nocheck); + ys_mean=evaluate_steady_state(oo_.steady_state,[oo_.exo_steady_state; oo_.exo_det_steady_state],M_,options_,~options_.steadystate.nocheck); end Y = transpose(dataset_.data); gend = dataset_.nobs; diff --git a/matlab/initial_estimation_checks.m b/matlab/initial_estimation_checks.m index e899e9744..47adc09aa 100644 --- a/matlab/initial_estimation_checks.m +++ b/matlab/initial_estimation_checks.m @@ -164,13 +164,13 @@ end old_steady_params=Model.params; %save initial parameters for check if steady state changes param values % % check if steady state solves static model (except if diffuse_filter == 1) -[DynareResults.steady_state, new_steady_params] = evaluate_steady_state(DynareResults.steady_state,Model,DynareOptions,DynareResults,DynareOptions.diffuse_filter==0); +[DynareResults.steady_state, new_steady_params] = evaluate_steady_state(DynareResults.steady_state,[DynareResults.exo_steady_state; DynareResults.exo_det_steady_state],Model,DynareOptions,DynareOptions.diffuse_filter==0); if isfield(EstimatedParameters,'param_vals') && ~isempty(EstimatedParameters.param_vals) %check whether steady state file changes estimated parameters Model_par_varied=Model; %store Model structure Model_par_varied.params(EstimatedParameters.param_vals(:,1))=Model_par_varied.params(EstimatedParameters.param_vals(:,1))*1.01; %vary parameters - [~, new_steady_params_2] = evaluate_steady_state(DynareResults.steady_state,Model_par_varied,DynareOptions,DynareResults,DynareOptions.diffuse_filter==0); + [~, new_steady_params_2] = evaluate_steady_state(DynareResults.steady_state,[DynareResults.exo_steady_state; DynareResults.exo_det_steady_state],Model_par_varied,DynareOptions,DynareOptions.diffuse_filter==0); changed_par_indices=find((old_steady_params(EstimatedParameters.param_vals(:,1))-new_steady_params(EstimatedParameters.param_vals(:,1))) ... | (Model_par_varied.params(EstimatedParameters.param_vals(:,1))-new_steady_params_2(EstimatedParameters.param_vals(:,1)))); diff --git a/matlab/model_diagnostics.m b/matlab/model_diagnostics.m index 845bc8586..890a1bfae 100644 --- a/matlab/model_diagnostics.m +++ b/matlab/model_diagnostics.m @@ -111,7 +111,7 @@ if options.logged_steady_state %if steady state was previously logged, undo this oo.steady_state=exp(oo.steady_state); options.logged_steady_state=0; end -[dr.ys,M.params,check1]=evaluate_steady_state(oo.steady_state,M,options,oo,options.steadystate.nocheck); +[dr.ys,M.params,check1]=evaluate_steady_state(oo.steady_state,[oo.exo_steady_state; oo.exo_det_steady_state],M,options,options.steadystate.nocheck); % testing for problem if check1(1) diff --git a/matlab/perfect-foresight-models/perfect_foresight_with_expectation_errors_setup.m b/matlab/perfect-foresight-models/perfect_foresight_with_expectation_errors_setup.m index 3b57d4559..a50fa6c01 100644 --- a/matlab/perfect-foresight-models/perfect_foresight_with_expectation_errors_setup.m +++ b/matlab/perfect-foresight-models/perfect_foresight_with_expectation_errors_setup.m @@ -127,7 +127,6 @@ end %% Compute the terminal steady state for all informational periods oo_.pfwee.terminal_steady_state = NaN(M_.endo_nbr, periods); -orig_exo_steady_state = oo_.exo_steady_state; for p = 1:periods if p > 1 && all(oo_.pfwee.terminal_info(:, p) == oo_.pfwee.terminal_info(:, p-1)) oo_.pfwee.terminal_steady_state(:, p) = oo_.pfwee.terminal_steady_state(:, p-1); @@ -137,11 +136,9 @@ for p = 1:periods else init = oo_.pfwee.terminal_steady_state(:, p-1); end - oo_.exo_steady_state = oo_.pfwee.terminal_info(:, p); - oo_.pfwee.terminal_steady_state(:, p) = evaluate_steady_state(init, M_, options_, oo_, true); + oo_.pfwee.terminal_steady_state(:, p) = evaluate_steady_state(init, oo_.pfwee.terminal_info(:, p), M_, options_, true); end end -oo_.exo_steady_state = orig_exo_steady_state; % Build initial paths for endos and exos (only initial conditions are set, the rest is NaN) if isempty(ys0_) diff --git a/matlab/resid.m b/matlab/resid.m index 620ace448..9f2645513 100644 --- a/matlab/resid.m +++ b/matlab/resid.m @@ -62,7 +62,7 @@ end if options_.steadystate_flag [oo_.steady_state,M_.params,info] = ... - evaluate_steady_state(oo_.steady_state,M_,options_,oo_,0); + evaluate_steady_state(oo_.steady_state,[oo_.exo_steady_state; oo_.exo_det_steady_state],M_,options_,false); end % Compute the residuals diff --git a/matlab/resol.m b/matlab/resol.m index 6c3fd30e5..0726b309d 100644 --- a/matlab/resol.m +++ b/matlab/resol.m @@ -74,7 +74,7 @@ if M.exo_nbr == 0 oo.exo_steady_state = [] ; end -[dr.ys,M.params,info] = evaluate_steady_state(oo.steady_state,M,options,oo,~options.steadystate.nocheck); +[dr.ys,M.params,info] = evaluate_steady_state(oo.steady_state,[oo.exo_steady_state; oo.exo_det_steady_state],M,options,~options.steadystate.nocheck); if info(1) oo.dr = dr; diff --git a/matlab/steady.m b/matlab/steady.m index f40b742ca..9db984a88 100644 --- a/matlab/steady.m +++ b/matlab/steady.m @@ -77,7 +77,7 @@ if info(1) end end -[oo_.steady_state,M_.params,info] = evaluate_steady_state(oo_.steady_state,M_,options_,oo_,~options_.steadystate.nocheck); +[oo_.steady_state,M_.params,info] = evaluate_steady_state(oo_.steady_state,[oo_.exo_steady_state; oo_.exo_det_steady_state],M_,options_,~options_.steadystate.nocheck); if info(1) == 0 if ~options_.noprint @@ -170,7 +170,7 @@ for i=1:step_nbr+1 oo.exo_steady_state(values(ix,2)) = points(ix,i); oo.exo_det_steady_state(values(ixd,2)) = points(ixd,i); - [steady_state,M.params,info] = evaluate_steady_state(oo.steady_state,M,options,oo,~options.steadystate.nocheck); + [steady_state,M.params,info] = evaluate_steady_state(oo.steady_state,[oo.exo_steady_state; oo.exo_det_steady_state],M,options,~options.steadystate.nocheck); if info(1) == 0 % if homotopy step is not successful, current values of steady % state are not modified @@ -261,7 +261,7 @@ for i = 1:nv disp([ 'HOMOTOPY mode 2: lauching solver with ' varname ' = ' num2str(v) ' ...']) - oo_.steady_state = evaluate_steady_state(oo_.steady_state,M_,options_,oo_,~options_.steadystate.nocheck); + oo_.steady_state = evaluate_steady_state(oo_.steady_state,[oo_.exo_steady_state; oo_.exo_det_steady_state],M_,options_,~options_.steadystate.nocheck); end end @@ -344,7 +344,7 @@ while iter <= step_nbr old_ss = oo.steady_state; - [steady_state,params,info] = evaluate_steady_state(old_ss,M,options,oo,~options.steadystate.nocheck); + [steady_state,params,info] = evaluate_steady_state(old_ss,[oo.exo_steady_state; oo.exo_det_steady_state],M,options,~options.steadystate.nocheck); if info(1) == 0 oo.steady_state = steady_state; M.params = params; diff --git a/tests/deterministic_simulations/pfwee.mod b/tests/deterministic_simulations/pfwee.mod index 918410196..dcca36310 100644 --- a/tests/deterministic_simulations/pfwee.mod +++ b/tests/deterministic_simulations/pfwee.mod @@ -49,7 +49,7 @@ perfect_foresight_solver; oo_.exo_simul(3,1) = 1.3; oo_.exo_steady_state = 1.1; oo_.exo_simul(end, 1) = oo_.exo_steady_state; -oo_.steady_state = evaluate_steady_state(oo_.steady_state, M_, options_, oo_, true); +oo_.steady_state = evaluate_steady_state(oo_.steady_state, oo_.exo_steady_state, M_, options_, true); oo_.endo_simul(:, end) = oo_.steady_state; options_.periods = 6; saved_endo = oo_.endo_simul(:, 1); @@ -64,7 +64,7 @@ oo_.exo_simul = [ saved_exo; oo_.exo_simul ]; oo_.exo_simul(4,1) = 1.4; oo_.exo_steady_state = 1.2; oo_.exo_simul(end, 1) = oo_.exo_steady_state; -oo_.steady_state = evaluate_steady_state(oo_.steady_state, M_, options_, oo_, true); +oo_.steady_state = evaluate_steady_state(oo_.steady_state, oo_.exo_steady_state, M_, options_, true); oo_.endo_simul(:, end) = oo_.steady_state; options_.periods = 5; saved_endo = oo_.endo_simul(:, 1:2); @@ -80,7 +80,7 @@ oo_.exo_simul(7,1) = 1.1; oo_.exo_simul(8,1) = 1.1; oo_.exo_steady_state = 1.1; oo_.exo_simul(end, 1) = oo_.exo_steady_state; -oo_.steady_state = evaluate_steady_state(oo_.steady_state, M_, options_, oo_, true); +oo_.steady_state = evaluate_steady_state(oo_.steady_state, oo_.exo_steady_state, M_, options_, true); oo_.endo_simul(:, end) = oo_.steady_state; options_.periods = 2; saved_endo = oo_.endo_simul(:, 1:5); diff --git a/tests/deterministic_simulations/pfwee_constant_sim_length.mod b/tests/deterministic_simulations/pfwee_constant_sim_length.mod index 250b4e673..d8a9e0bde 100644 --- a/tests/deterministic_simulations/pfwee_constant_sim_length.mod +++ b/tests/deterministic_simulations/pfwee_constant_sim_length.mod @@ -50,7 +50,7 @@ perfect_foresight_solver; oo_.exo_simul(3,1) = 1.3; oo_.exo_steady_state = 1.1; oo_.exo_simul(9:10, 1) = repmat(oo_.exo_steady_state', 2, 1); -oo_.steady_state = evaluate_steady_state(oo_.steady_state, M_, options_, oo_, true); +oo_.steady_state = evaluate_steady_state(oo_.steady_state, oo_.exo_steady_state, M_, options_, true); oo_.endo_simul(:, 10) = oo_.steady_state; saved_endo = oo_.endo_simul(:, 1); saved_exo = oo_.exo_simul(1, :); @@ -64,7 +64,7 @@ oo_.exo_simul = [ saved_exo; oo_.exo_simul ]; oo_.exo_simul(4,1) = 1.4; oo_.exo_steady_state = 1.2; oo_.exo_simul(9:11, 1) = repmat(oo_.exo_steady_state', 3, 1); -oo_.steady_state = evaluate_steady_state(oo_.steady_state, M_, options_, oo_, true); +oo_.steady_state = evaluate_steady_state(oo_.steady_state, oo_.exo_steady_state, M_, options_, true); oo_.endo_simul(:, 11) = oo_.steady_state; saved_endo = oo_.endo_simul(:, 1:2); saved_exo = oo_.exo_simul(1:2, :); @@ -79,7 +79,7 @@ oo_.exo_simul(7,1) = 1.1; oo_.exo_simul(8,1) = 1.1; oo_.exo_steady_state = 1.1; oo_.exo_simul(9:14, 1) = repmat(oo_.exo_steady_state', 6, 1); -oo_.steady_state = evaluate_steady_state(oo_.steady_state, M_, options_, oo_, true); +oo_.steady_state = evaluate_steady_state(oo_.steady_state, oo_.exo_steady_state, M_, options_, true); oo_.endo_simul(:, 12:13) = repmat(initial_steady_state, 1, 2); oo_.endo_simul(:, 14) = oo_.steady_state; saved_endo = oo_.endo_simul(:, 1:5); diff --git a/tests/deterministic_simulations/pfwee_learnt_in.mod b/tests/deterministic_simulations/pfwee_learnt_in.mod index f12cd13ed..4d3dd4380 100644 --- a/tests/deterministic_simulations/pfwee_learnt_in.mod +++ b/tests/deterministic_simulations/pfwee_learnt_in.mod @@ -92,7 +92,7 @@ perfect_foresight_solver; oo_.exo_simul(3,1) = 1.3; oo_.exo_steady_state = 1.1; oo_.exo_simul(end, 1) = oo_.exo_steady_state; -oo_.steady_state = evaluate_steady_state(oo_.steady_state, M_, options_, oo_, true); +oo_.steady_state = evaluate_steady_state(oo_.steady_state, oo_.exo_steady_state, M_, options_, true); oo_.endo_simul(:, end) = oo_.steady_state; options_.periods = 6; saved_endo = oo_.endo_simul(:, 1); @@ -108,7 +108,7 @@ oo_.exo_simul(4,1) = 1.4; oo_.exo_simul(8,1) = 1.5; oo_.exo_steady_state = 1.1+0.1; oo_.exo_simul(end, 1) = oo_.exo_steady_state; -oo_.steady_state = evaluate_steady_state(oo_.steady_state, M_, options_, oo_, true); +oo_.steady_state = evaluate_steady_state(oo_.steady_state, oo_.exo_steady_state, M_, options_, true); oo_.endo_simul(:, end) = oo_.steady_state; options_.periods = 5; saved_endo = oo_.endo_simul(:, 1:2); @@ -124,7 +124,7 @@ oo_.exo_simul(7,1) = 1*0.8; oo_.exo_simul(8,1) = 1.5*0.8; oo_.exo_steady_state = (1.1+0.1)*0.75; oo_.exo_simul(end, 1) = oo_.exo_steady_state; -oo_.steady_state = evaluate_steady_state(oo_.steady_state, M_, options_, oo_, true); +oo_.steady_state = evaluate_steady_state(oo_.steady_state, oo_.exo_steady_state, M_, options_, true); oo_.endo_simul(:, end) = oo_.steady_state; options_.periods = 2; saved_endo = oo_.endo_simul(:, 1:5); diff --git a/tests/prior_posterior_function/posterior_function_demo.m b/tests/prior_posterior_function/posterior_function_demo.m index 915f4fe70..2710432e8 100644 --- a/tests/prior_posterior_function/posterior_function_demo.m +++ b/tests/prior_posterior_function/posterior_function_demo.m @@ -24,7 +24,7 @@ function output_cell =posterior_function_demo(xparam1,M_,options_,oo_,estim_para % output_cell [1 by n cell] 1 by n Matlab cell allowing to store any % desired computation or result (strings, matrices, structures, etc.) -% Copyright © 2015 Dynare Team +% Copyright © 2015-2023 Dynare Team % % This file is part of Dynare. % @@ -49,8 +49,8 @@ output_cell{1,1}=mean(xparam1); % set the parameters draws to the model structure M_ = set_all_parameters(xparam1,estim_params_,M_); % compute the steady state for the parameter draw written to M_ -[ys,params,info] = evaluate_steady_state(oo_.steady_state,M_,options_,oo_,0); +[ys,params,info] = evaluate_steady_state(oo_.steady_state,[oo_.exo_steady_state; oo_.exo_det_steady_state],M_,options_,false); %set second part of output cell output_cell{1,2}=ys'; -end \ No newline at end of file +end