Merge branch 'JohannesPfeifer/dynare-options_output'

See merge request !1878
time-shift
Sébastien Villemot 2021-06-22 18:17:26 +02:00
commit e79b2798df
No known key found for this signature in database
GPG Key ID: 2CECE9350ECEBE4A
49 changed files with 67 additions and 73 deletions

View File

@ -1,4 +1,4 @@
function [alphahat,etahat,epsilonhat,ahat,SteadyState,trend_coeff,aK,T,R,P,PK,decomp,trend_addition,state_uncertainty,M_,oo_,options_,bayestopt_] = DsgeSmoother(xparam1,gend,Y,data_index,missing_value,M_,oo_,options_,bayestopt_,estim_params_)
function [alphahat,etahat,epsilonhat,ahat,SteadyState,trend_coeff,aK,T,R,P,PK,decomp,trend_addition,state_uncertainty,M_,oo_,bayestopt_] = DsgeSmoother(xparam1,gend,Y,data_index,missing_value,M_,oo_,options_,bayestopt_,estim_params_)
% Estimation of the smoothed variables and innovations.
%
% INPUTS
@ -34,7 +34,6 @@ function [alphahat,etahat,epsilonhat,ahat,SteadyState,trend_coeff,aK,T,R,P,PK,de
% about the smoothed state (decision-rule order)
% o M_ [structure] decribing the model
% o oo_ [structure] storing the results
% o options_ [structure] describing the options
% o bayestopt_ [structure] describing the priors
%
% Notes:
@ -105,14 +104,14 @@ if ~options_.smoother_redux
oo_.dr.restrict_var_list = bayestopt_.smoother_var_list;
oo_.dr.restrict_columns = bayestopt_.smoother_restrict_columns;
[T,R,SteadyState,info,M_,options_,oo_] = dynare_resolve(M_,options_,oo_);
[T,R,SteadyState,info,M_,oo_] = dynare_resolve(M_,options_,oo_);
%get location of observed variables and requested smoothed variables in
%decision rules
bayestopt_.mf = bayestopt_.smoother_var_list(bayestopt_.smoother_mf);
else
[T,R,SteadyState,info,M_,options_,oo_] = dynare_resolve(M_,options_,oo_,'restrict');
[T,R,SteadyState,info,M_,oo_] = dynare_resolve(M_,options_,oo_,'restrict');
bayestopt_.mf = bayestopt_.mf1;
end

View File

@ -145,7 +145,7 @@ while fpar<B
end
stock_param(irun2,:) = deep;
set_parameters(deep);
[dr,info,M_,options_,oo_] =compute_decision_rules(M_,options_,oo_);
[dr,info,M_,oo_] =compute_decision_rules(M_,options_,oo_);
oo_.dr = dr;
if info(1)
nosaddle = nosaddle + 1;

View File

@ -42,7 +42,7 @@ end
oo.dr=set_state_space(oo.dr,M,options);
[dr,info,M,options,~] = resol(1,M,options,oo);
[dr,info,M,~] = resol(1,M,options,oo);
if info(1) ~= 0 && info(1) ~= 3 && info(1) ~= 4
print_info(info, 0, options);

View File

@ -137,7 +137,7 @@ if ismember('moments', varargin) % Prior simulations (2nd order moments).
oo__ = oo_;
oo__.dr = set_state_space(oo__.dr, Model, options_);
% Solve model
[T,R,~,info,Model , options__ , oo__] = dynare_resolve(Model , options_ ,oo__,'restrict');
[T,R,~,info,Model , oo__] = dynare_resolve(Model , options_ ,oo__,'restrict');
if ~info(1)
info=endogenous_prior_restrictions(T,R,Model , options__ , oo__);
end

View File

@ -1,4 +1,4 @@
function [dr,info,M_,options_,oo_] =compute_decision_rules(M_,options_,oo_)
function [dr,info,M_,oo_] =compute_decision_rules(M_,options_,oo_)
% function [dr,info,M_,options_,oo_] =compute_decision_rules(M_,options_,oo_)
% INPUTS
% - M_ [structure] Matlab's structure describing the model (M_).
@ -9,7 +9,6 @@ function [dr,info,M_,options_,oo_] =compute_decision_rules(M_,options_,oo_)
% - dr [structure] Reduced form model.
% - info [integer] scalar or vector, error code.
% - M_ [structure] Matlab's structure describing the model (M_).
% - options_ [structure] Matlab's structure describing the current options (options_).
% - oo_ [structure] Matlab's structure containing the results (oo_).
% Copyright (C) 2020 Dynare Team
@ -30,7 +29,7 @@ function [dr,info,M_,options_,oo_] =compute_decision_rules(M_,options_,oo_)
% along with Dynare. If not, see <https://www.gnu.org/licenses/>.
if options_.discretionary_policy
[dr,info,M_,options_,oo_] = discretionary_policy_1(options_.instruments,M_,options_,oo_);
[dr,info,M_,oo_] = discretionary_policy_1(options_.instruments,M_,options_,oo_);
else
[dr,info,M_,options_,oo_] = resol(0,M_,options_,oo_);
[dr,info,M_,oo_] = resol(0,M_,options_,oo_);
end

View File

@ -1,4 +1,4 @@
function [dr, info, M_, options_, oo_]=discretionary_policy_1(Instruments, M_, options_, oo_)
function [dr, info, M_, oo_]=discretionary_policy_1(Instruments, M_, options_, oo_)
% Higher-level function for solving discretionary optimal policy
% INPUTS
% - Instruments [cell] array containing instrument names
@ -10,7 +10,6 @@ function [dr, info, M_, options_, oo_]=discretionary_policy_1(Instruments, M_, o
% - dr [structure] Reduced form model.
% - info [integer] scalar or vector, error code.
% - M_ [structure] Matlab's structure describing the model (M_).
% - options_ [structure] Matlab's structure describing the current options (options_).
% - oo_ [structure] Matlab's structure containing the results (oo_).
% Copyright (C) 2007-2020 Dynare Team

View File

@ -1,5 +1,5 @@
function [dr,info,M_,options_,oo_] = dr_block(dr,task,M_,options_,oo_,varargin)
% function [dr,info,M_,options_,oo_] = dr_block(dr,task,M_,options_,oo_,varargin)
function [dr,info,M_,oo_] = dr_block(dr,task,M_,options_,oo_,varargin)
% function [dr,info,M_,oo_] = dr_block(dr,task,M_,options_,oo_,varargin)
% computes the reduced form solution of a rational expectations block-decomposed model
% (first order approximation of the stochastic model around the deterministic steady state).
%
@ -26,7 +26,6 @@ function [dr,info,M_,options_,oo_] = dr_block(dr,task,M_,options_,oo_,varargin)
% info=5: BK rank condition not satisfied.
% info=6: The jacobian matrix evaluated at the steady state is complex.
% M_ [matlab structure]
% options_ [matlab structure]
% oo_ [matlab structure]
%
% ALGORITHM

View File

@ -185,7 +185,7 @@ end
%------------------------------------------------------------------------------
% Linearize the model around the deterministic steady state and extract the matrices of the state equation (T and R).
[T,R,SteadyState,info,Model,DynareOptions,DynareResults] = dynare_resolve(Model,DynareOptions,DynareResults,'restrict');
[T,R,SteadyState,info,Model,DynareResults] = dynare_resolve(Model,DynareOptions,DynareResults,'restrict');
% Return, with endogenous penalty when possible, if dynare_resolve issues an error code (defined in resol).
if info(1)
@ -467,7 +467,7 @@ if analytic_derivation
AHess = [];
iv = DynareResults.dr.restrict_var_list;
if nargin<10 || isempty(derivatives_info)
[A,B,nou,nou,Model,DynareOptions,DynareResults] = dynare_resolve(Model,DynareOptions,DynareResults);
[A,B,nou,nou,Model,DynareResults] = dynare_resolve(Model,DynareOptions,DynareResults);
if ~isempty(EstimatedParameters.var_exo)
indexo=EstimatedParameters.var_exo(:,1);
else

View File

@ -142,7 +142,7 @@ for file = 1:NumberOfDrawsFiles
dr = temp.pdraws{linee,2};
else
M_=set_parameters_locally(M_,temp.pdraws{linee,1});
[dr,info,M_,options_,oo_] = compute_decision_rules(M_,options_,oo_)
[dr,info,M_,oo_] = compute_decision_rules(M_,options_,oo_)
end
if first_call
endo_nbr = M_.endo_nbr;

View File

@ -115,7 +115,7 @@ for file = 1:NumberOfDrawsFiles
dr = temp.pdraws{linee,2};
else
M_=set_parameters_locally(M_,temp.pdraws{linee,1});
[dr,info,M_,options_,oo_] = compute_decision_rules(M_,options_,oo_);
[dr,info,M_,oo_] = compute_decision_rules(M_,options_,oo_);
end
if ~options_.pruning
tmp = th_autocovariances(dr,ivar,M_,options_,nodecomposition);

View File

@ -113,7 +113,7 @@ for file = 1:NumberOfDrawsFiles
dr = temp.pdraws{linee,2};
else
M_=set_parameters_locally(M_,temp.pdraws{linee,1});
[dr,info,M_,options_,oo_] = compute_decision_rules(M_,options_,oo_);
[dr,info,M_,oo_] = compute_decision_rules(M_,options_,oo_);
end
if ~options_.pruning
tmp = th_autocovariances(dr,ivar,M_,options_,nodecomposition);

View File

@ -141,7 +141,7 @@ for file = 1:NumberOfDrawsFiles
dr = temp.pdraws{linee,2};
else
M_=set_parameters_locally(M_,temp.pdraws{linee,1});
[dr,info,M_,options_,oo_] = compute_decision_rules(M_,options_,oo_);
[dr,info,M_,oo_] = compute_decision_rules(M_,options_,oo_);
end
if file==1 && linee==1
[tmp, stationary_vars] = th_autocovariances(dr,ivar,M_,options_,nodecomposition);

View File

@ -133,7 +133,7 @@ end
% Solve the Dsge model and get the matrices of the reduced form solution. T and R are the matrices of the
% state equation
[T,R,SteadyState,info,Model,DynareOptions,DynareResults] = dynare_resolve(Model,DynareOptions,DynareResults,'restrict');
[T,R,SteadyState,info,Model,DynareResults] = dynare_resolve(Model,DynareOptions,DynareResults,'restrict');
% Return, with endogenous penalty when possible, if dynare_resolve issues an error code (defined in resol).
if info(1)

View File

@ -176,7 +176,7 @@ end
if isequal(options_.mode_compute,0) && isempty(options_.mode_file) && options_.mh_posterior_mode_estimation==0
if options_.order==1 && ~options_.particle.status
if options_.smoother
[atT,innov,measurement_error,updated_variables,ys,trend_coeff,aK,T,R,P,PK,decomp,Trend,state_uncertainty,M_,oo_,options_,bayestopt_] = DsgeSmoother(xparam1,gend,transpose(data),data_index,missing_value,M_,oo_,options_,bayestopt_,estim_params_);
[atT,innov,measurement_error,updated_variables,ys,trend_coeff,aK,T,R,P,PK,decomp,Trend,state_uncertainty,M_,oo_,bayestopt_] = DsgeSmoother(xparam1,gend,transpose(data),data_index,missing_value,M_,oo_,options_,bayestopt_,estim_params_);
[oo_]=store_smoother_results(M_,oo_,options_,bayestopt_,dataset_,dataset_info,atT,innov,measurement_error,updated_variables,ys,trend_coeff,aK,P,PK,decomp,Trend,state_uncertainty);
if options_.forecast > 0
oo_.forecast = dyn_forecast(var_list_,M_,options_,oo_,'smoother',dataset_info);
@ -554,7 +554,7 @@ end
if (~((any(bayestopt_.pshape > 0) && options_.mh_replic) || (any(bayestopt_.pshape> 0) && options_.load_mh_file)) ...
|| ~options_.smoother ) && ~options_.partial_information % to be fixed
%% ML estimation, or posterior mode without Metropolis-Hastings or Metropolis without Bayesian smoothes variables
[atT,innov,measurement_error,updated_variables,ys,trend_coeff,aK,T,R,P,PK,decomp,Trend,state_uncertainty,M_,oo_,options_,bayestopt_] = DsgeSmoother(xparam1,dataset_.nobs,transpose(dataset_.data),dataset_info.missing.aindex,dataset_info.missing.state,M_,oo_,options_,bayestopt_,estim_params_);
[atT,innov,measurement_error,updated_variables,ys,trend_coeff,aK,T,R,P,PK,decomp,Trend,state_uncertainty,M_,oo_,bayestopt_] = DsgeSmoother(xparam1,dataset_.nobs,transpose(dataset_.data),dataset_info.missing.aindex,dataset_info.missing.state,M_,oo_,options_,bayestopt_,estim_params_);
[oo_,yf]=store_smoother_results(M_,oo_,options_,bayestopt_,dataset_,dataset_info,atT,innov,measurement_error,updated_variables,ys,trend_coeff,aK,P,PK,decomp,Trend,state_uncertainty);
if ~options_.nograph

View File

@ -1,4 +1,4 @@
function [A,B,ys,info,M_,options_,oo_] = dynare_resolve(M_,options_,oo_,mode)
function [A,B,ys,info,M_,oo_] = dynare_resolve(M_,options_,oo_,mode)
% function [A,B,ys,info,M_,options_,oo_] = dynare_resolve(M_,options_,oo_,mode)
% Computes the linear approximation and the matrices A and B of the transition equation.
%
@ -14,7 +14,6 @@ function [A,B,ys,info,M_,options_,oo_] = dynare_resolve(M_,options_,oo_,mode)
% - ys [double] vector of steady state values
% - info [double] 4 by 1 vector with exit flag and information
% - M_ [structure] Matlab's structure describing the model
% - options_ [structure] Matlab's structure containing the options
% - oo_ [structure] Matlab's structure containing the results
% Copyright (C) 2001-2021 Dynare Team
@ -34,7 +33,7 @@ function [A,B,ys,info,M_,options_,oo_] = dynare_resolve(M_,options_,oo_,mode)
% You should have received a copy of the GNU General Public License
% along with Dynare. If not, see <https://www.gnu.org/licenses/>.
[dr,info,M_,options_,oo_] =compute_decision_rules(M_,options_,oo_);
[dr,info,M_,oo_] =compute_decision_rules(M_,options_,oo_);
if info(1) > 0
A = [];

View File

@ -137,7 +137,7 @@ if M_.exo_nbr==0
error('dynare_sensitivity does not support having no varexo in the model. As a workaround you could define a dummy exogenous variable.')
end
[make,my,day,punk,M_,options_,oo_] = dynare_resolve(M_,options_,oo_);
[make,my,day,punk,M_,oo_] = dynare_resolve(M_,options_,oo_);
options_gsa = set_default_option(options_gsa,'identification',0);
if options_gsa.identification

View File

@ -49,7 +49,7 @@ if ~isempty(endo_prior_restrictions.irf)
end
varlist = Model.endo_names(DynareResults.dr.order_var);
if isempty(T)
[T,R,SteadyState,infox,Model,DynareOptions,DynareResults] = dynare_resolve(Model,DynareOptions,DynareResults);
[T,R,SteadyState,infox,Model,DynareResults] = dynare_resolve(Model,DynareOptions,DynareResults);
else % check if T and R are given in the restricted form!!!
if size(T,1)<length(varlist)
varlist = varlist(DynareResults.dr.restrict_var_list);
@ -63,7 +63,7 @@ if ~isempty(endo_prior_restrictions.irf)
end
if ~varlistok
varlist = Model.endo_names(DynareResults.dr.order_var);
[T,R,SteadyState,infox,Model,DynareOptions,DynareResults] = dynare_resolve(Model,DynareOptions,DynareResults);
[T,R,SteadyState,infox,Model,DynareResults] = dynare_resolve(Model,DynareOptions,DynareResults);
end
end
NT=1;

View File

@ -78,7 +78,7 @@ dr = struct();
if ep.init
DynareOptions.order = 1;
DynareResults.dr=set_state_space(dr,DynareModel,DynareOptions);
[dr,Info,DynareModel,DynareOptions,DynareResults] = resol(0,DynareModel,DynareOptions,DynareResults);
[dr,Info,DynareResults] = resol(0,DynareModel,DynareOptions,DynareResults);
end
% Do not use a minimal number of perdiods for the perfect foresight solver (with bytecode and blocks)

View File

@ -101,7 +101,7 @@ if ischar(parameters)
end
end
[atT,innov,measurement_error,updated_variables,ys,trend_coeff,aK,T,R,P,PK,decomp,Trend,state_uncertainty,M_,oo_,options_,bayestopt_] = ...
[atT,innov,measurement_error,updated_variables,ys,trend_coeff,aK,T,R,P,PK,decomp,Trend,state_uncertainty,M_,oo_,bayestopt_] = ...
DsgeSmoother(parameters,dataset_.nobs,transpose(dataset_.data),dataset_info.missing.aindex,dataset_info.missing.state,M_,oo_,options_,bayestopt_,estim_params_);
[oo_]=store_smoother_results(M_,oo_,options_,bayestopt_,dataset_,dataset_info,atT,innov,measurement_error,updated_variables,ys,trend_coeff,aK,P,PK,decomp,Trend,state_uncertainty);

View File

@ -51,7 +51,7 @@ function [out,info] = get_perturbation_params_derivs_numerical_objective(params,
%% Update stderr, corr and model parameters and compute perturbation approximation and steady state with updated parameters
M = set_all_parameters(params,estim_params,M);
[~,info,M,options,oo] = compute_decision_rules(M,options,oo);
[~,info,M,oo] = compute_decision_rules(M,options,oo);
Sigma_e = M.Sigma_e;
if info(1) > 0

View File

@ -102,9 +102,9 @@ if init
for j=1:Nsam
Model = set_all_parameters(lpmat(j,:)',EstimatedParameters,Model);
if nbr_moment_restrictions
[Tt,Rr,SteadyState,info,Model,DynareOptions,DynareResults] = dynare_resolve(Model,DynareOptions,DynareResults);
[Tt,Rr,SteadyState,info,Model,DynareResults] = dynare_resolve(Model,DynareOptions,DynareResults);
else
[Tt,Rr,SteadyState,info,Model,DynareOptions,DynareResults] = dynare_resolve(Model,DynareOptions,DynareResults,'restrict');
[Tt,Rr,SteadyState,info,Model,DynareResults] = dynare_resolve(Model,DynareOptions,DynareResults,'restrict');
end
if info(1)==0
[info, info_irf, info_moment, data_irf, data_moment]=endogenous_prior_restrictions(Tt,Rr,Model,DynareOptions,DynareResults);

View File

@ -310,9 +310,9 @@ if fload==0
%try stoch_simul([]);
try
if ~ isempty(options_.endogenous_prior_restrictions.moment)
[Tt,Rr,SteadyState,info,M_,options_,oo_] = dynare_resolve(M_,options_,oo_);
[Tt,Rr,SteadyState,info,M_,oo_] = dynare_resolve(M_,options_,oo_);
else
[Tt,Rr,SteadyState,info,M_,options_,oo_] = dynare_resolve(M_,options_,oo_,'restrict');
[Tt,Rr,SteadyState,info,M_,oo_] = dynare_resolve(M_,options_,oo_,'restrict');
end
infox(j,1)=info(1);
if infox(j,1)==0 && ~exist('T','var')
@ -681,7 +681,7 @@ if length(iunstable)>0 || length(iwrong)>0
end
M_ = set_all_parameters(x0,estim_params_,M_);
[oo_.dr,info,M_,options_,oo_] = resol(0,M_,options_,oo_);
[oo_.dr,info,M_,oo_] = resol(0,M_,options_,oo_);
% stoch_simul([]);
else
disp('All parameter values in the specified ranges are not acceptable!')

View File

@ -133,7 +133,7 @@ no_identification_minimal = options_ident.no_identification_minimal;
no_identification_spectrum = options_ident.no_identification_spectrum;
%Compute linear approximation and fill dr structure
[oo_.dr,info,M_,options_,oo_] = compute_decision_rules(M_,options_,oo_);
[oo_.dr,info,M_,oo_] = compute_decision_rules(M_,options_,oo_);
if info(1) == 0 %no errors in solution
% Compute parameter Jacobians for identification analysis

View File

@ -76,7 +76,7 @@ else
end
%% compute Kalman transition matrices and steady state with updated parameters
[~,info,M,options,oo] = compute_decision_rules(M,options,oo);
[~,info,M,oo] = compute_decision_rules(M,options,oo);
options = rmfield(options,'options_ident');
pruned = pruned_state_space_system(M, options, oo.dr, indvar, nlags, useautocorr, 0);

View File

@ -126,7 +126,7 @@ if estimated_model
qz_criterium_old=options_.qz_criterium;
options_=select_qz_criterium_value(options_);
options_smoothed_state_uncertainty_old = options_.smoothed_state_uncertainty;
[atT, ~, ~, ~,ys, ~, ~, ~, ~, ~, ~, ~, ~, ~,M_,oo_,options_,bayestopt_] = ...
[atT, ~, ~, ~,ys, ~, ~, ~, ~, ~, ~, ~, ~, ~,M_,oo_,bayestopt_] = ...
DsgeSmoother(xparam, gend, data, data_index, missing_value, M_, oo_, options_, bayestopt_, estim_params_);
options_.smoothed_state_uncertainty = options_smoothed_state_uncertainty_old;
%get constant part
@ -171,7 +171,7 @@ if options_.logged_steady_state %if steady state was previously logged, undo thi
options_.logged_steady_state=0;
end
[T, R, ys, ~, M_, options_, oo_] = dynare_resolve(M_, options_, oo_);
[T, R, ys, ~, M_, oo_] = dynare_resolve(M_, options_, oo_);
if options_.loglinear && isfield(oo_.dr,'ys') && options_.logged_steady_state==0 %log steady state
oo_.dr.ys=log_variable(1:M_.endo_nbr,oo_.dr.ys,M_);

View File

@ -96,7 +96,7 @@ end
%--------------------------------------------------------------------------
% Compute linear approximation around the deterministic steady state
[dr, info, M_, options_mom_, oo_] = resol(0, M_, options_mom_, oo_);
[dr, info, M_, oo_] = resol(0, M_, options_mom_, oo_);
% Return, with endogenous penalty when possible, if resol issues an error code
if info(1)

View File

@ -122,7 +122,7 @@ end
%-----------------------------
M_ = set_all_parameters(xparams,EstimatedParams,DynareModel);
[dr,info,DynareModel,DynareOptions,DynareResults] = resol(0,DynareModel,DynareOptions,DynareResults);
[dr,info,DynareModel,DynareResults] = resol(0,DynareModel,DynareOptions,DynareResults);
% Return, with endogenous penalty when possible, if dynare_resolve issues an error code (defined in resol).
if info(1)

View File

@ -80,7 +80,7 @@ end
%------------------------------------------------------------------------------
% Linearize the model around the deterministic sdteadystate and extract the matrices of the state equation (T and R).
[dr, info, Model, DynareOptions, DynareResults] = resol(0, Model, DynareOptions, DynareResults);
[dr, info, Model, DynareResults] = resol(0, Model, DynareOptions, DynareResults);
if info(1)
if info(1) == 3 || info(1) == 4 || info(1) == 5 || info(1)==6 ||info(1) == 19 || ...

View File

@ -29,7 +29,7 @@ while look_for_admissible_initial_condition
xinit = xparam1+scale*randn(size(xparam1));
if all(xinit(:)>BayesInfo.p3) && all(xinit(:)<BayesInfo.p4)
ModelInfo = set_all_parameters(xinit,EstimationInfo,ModelInfo);
[dr,INFO,ModelInfo,DynareOptions,DynareResults] = resol(0,ModelInfo,DynareOptions,DynareResults);
[dr,INFO,ModelInfo,DynareResults] = resol(0,ModelInfo,DynareOptions,DynareResults);
if ~INFO(1)
look_for_admissible_initial_condition = 0;
end

View File

@ -143,7 +143,7 @@ if ~options_.noprint
fprintf('Objective function : %16.6g\n\n',f);
skipline()
end
[oo_.dr,info,M_,options_,oo_] = resol(0,M_,options_,oo_);
[oo_.dr,info,M_,oo_] = resol(0,M_,options_,oo_);
if ~info
osr_res.error_indicator=0;
end

View File

@ -47,7 +47,7 @@ M_.params(i_params) = x;
% don't change below until the part where the loss function is computed
it_ = M_.maximum_lag+1;
[dr,info,M_,options_,oo_] = resol(0,M_,options_,oo_);
[dr,info,M_,oo_] = resol(0,M_,options_,oo_);
if info(1)
if info(1) == 3 || info(1) == 4 || info(1) == 5 || info(1)==6 ||info(1) == 19 ||...

@ -1 +1 @@
Subproject commit a5c2c4af4b4aeeb9f4a51860c244d790dac3b8b5
Subproject commit 1451bf64a2de2f3e8c78cb91bf4e045732f337ab

View File

@ -47,7 +47,7 @@ if ~isfield(oo_,'dr') || ~isfield(oo_.dr,'ghx')
dr = struct();
oo_.dr=set_state_space(dr,M_,options_);
options_.order = 1;
[dr,Info,M_,options_,oo_] = resol(0,M_,options_,oo_);
[dr,Info,M_,oo_] = resol(0,M_,options_,oo_);
fprintf('done\n');
end
b_surprise = 0;

View File

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

View File

@ -213,17 +213,17 @@ for b=fpar:B
M_ = set_all_parameters(deep,estim_params_,M_);
if run_smoother
[dr,info,M_,opts_local,oo_] =compute_decision_rules(M_,opts_local,oo_);
[dr,info,M_,oo_] =compute_decision_rules(M_,opts_local,oo_);
if ismember(info(1),[3,4])
opts_local.qz_criterium = 1 + (opts_local.qz_criterium-1)*10; %loosen tolerance, useful for big models where BK conditions were tested on restricted state space
[dr,info,M_,opts_local,oo_] =compute_decision_rules(M_,opts_local,oo_);
[dr,info,M_,oo_] =compute_decision_rules(M_,opts_local,oo_);
end
if info(1)
message=get_error_message(info,opts_local);
fprintf('\nprior_posterior_statistics: One of the draws failed with the error:\n%s\n',message)
fprintf('prior_posterior_statistics: This should not happen. Please contact the developers.\n',message)
end
[alphahat,etahat,epsilonhat,alphatilde,SteadyState,trend_coeff,aK,~,~,P,~,~,trend_addition,state_uncertainty,M_,oo_,opts_local,bayestopt_] = ...
[alphahat,etahat,epsilonhat,alphatilde,SteadyState,trend_coeff,aK,~,~,P,~,~,trend_addition,state_uncertainty,M_,oo_,bayestopt_] = ...
DsgeSmoother(deep,gend,Y,data_index,missing_value,M_,oo_,opts_local,bayestopt_,estim_params_);
stock_trend_coeff(options_.varobs_id,irun(9))=trend_coeff;
@ -354,7 +354,7 @@ for b=fpar:B
stock_smoothed_uncert(dr.order_var,dr.order_var,:,irun(13)) = state_uncertainty;
end
else
[T,R,SteadyState,info,M_,options_,oo_] = dynare_resolve(M_,options_,oo_);
[T,R,SteadyState,info,M_,oo_] = dynare_resolve(M_,options_,oo_);
end
stock_param(irun(5),:) = deep;
stock_logpo(irun(5),1) = logpo;

View File

@ -96,7 +96,7 @@ while iteration < NumberOfSimulations
loop_indx = loop_indx+1;
params = prior_draw();
M_ = set_all_parameters(params,estim_params_,M_);
[T,R,~,INFO,M_,options_,oo_] = dynare_resolve(M_,options_,oo_,'restrict');
[T,R,~,INFO,M_,oo_] = dynare_resolve(M_,options_,oo_,'restrict');
dr=oo_.dr;
if ~INFO(1)
INFO=endogenous_prior_restrictions(T,R,M_,options_,oo_);

View File

@ -113,7 +113,7 @@ nobs = options_.nobs;
if forecast_ && any(forecast_params)
M1=M_;
M1.params = forecast_params;
[~,~,~,~,~,~,oo1] = dynare_resolve(M1,options_,oo_);
[~,~,~,~,~,oo1] = dynare_resolve(M1,options_,oo_);
end
gend0=0;

View File

@ -1,4 +1,4 @@
function [dr, info, M, options, oo] = resol(check_flag, M, options, oo)
function [dr, info, M, oo] = resol(check_flag, M, options, oo)
% Computes the perturbation based decision rules of the DSGE model (orders 1 to 3)
%
@ -12,7 +12,6 @@ function [dr, info, M, options, oo] = resol(check_flag, M, options, oo)
% - dr [structure] Reduced form model.
% - info [integer] scalar or vector, error code.
% - M [structure] Matlab's structure describing the model (M_).
% - options [structure] Matlab's structure describing the current options (options_).
% - oo [structure] Matlab's structure containing the results (oo_).
%
% REMARKS
@ -113,7 +112,7 @@ if options.loglinear
end
if options.block
[dr,info,M,options,oo] = dr_block(dr,check_flag,M,options,oo);
[dr,info,M,oo] = dr_block(dr,check_flag,M,options,oo);
dr.edim = nnz(abs(dr.eigval) > options.qz_criterium);
dr.sdim = dr.nd-dr.edim;
else

View File

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

View File

@ -115,7 +115,7 @@ if info
pdraws(i,1) = {x2(SampleAddress(i,4),:)};
if info-1
set_parameters(pdraws{i,1});
[dr,info,M_,options_,oo_] =compute_decision_rules(M_,options_,oo_);
[dr,info,M_,oo_] =compute_decision_rules(M_,options_,oo_);
pdraws(i,2) = { dr };
end
old_mhfile = mhfile;

View File

@ -71,7 +71,7 @@ else
logged_steady_state_indicator=0;
end
[dr,info,M_,options_,oo_] = compute_decision_rules(M_,options_,oo_);
[dr,info,M_,oo_] = compute_decision_rules(M_,options_,oo_);
oo_.dr=dr;
if info(1)
fprintf('\nsimulated_moment_uncertainty: model could not be solved')

View File

@ -99,14 +99,14 @@ elseif options_.discretionary_policy
if ~options_.order==1
error('discretionary_policy: only linear-quadratic problems can be solved');
end
[~,info,M_,options_,oo_] = discretionary_policy_1(options_.instruments,M_,options_,oo_);
[~,info,M_,oo_] = discretionary_policy_1(options_.instruments,M_,options_,oo_);
else
if options_.logged_steady_state %if steady state was previously logged, undo this
oo_.dr.ys=exp(oo_.dr.ys);
oo_.steady_state=exp(oo_.steady_state);
options_.logged_steady_state=0;
end
[~,info,M_,options_,oo_] = resol(0,M_,options_,oo_);
[~,info,M_,oo_] = resol(0,M_,options_,oo_);
end
if options_.loglinear && isfield(oo_.dr,'ys') && options_.logged_steady_state==0 %log steady state for correct display of decision rule

View File

@ -433,7 +433,7 @@ for jj = 1:2
xparam1_calib = [xparam1_calib; calib_params(indpmodel)];
M_ = set_all_parameters(xparam1_calib,estim_params_,M_);
end
[~,info,M_,options_,oo_] = resol(0,M_, options_, oo_);
[~,info,M_,oo_] = resol(0,M_, options_, oo_);
%For convenience we save the objects to compare into oo_.dr.
oo_.dr.Yss = oo_.dr.ys(oo_.dr.order_var);
oo_.dr.Sigma_e = M_.Sigma_e;

View File

@ -115,7 +115,7 @@ identification(order=@{ORDER},nograph,no_identification_strength);
%make sure everything is computed at prior mean
xparam_prior = set_prior(estim_params_,M_,options_);
M_ = set_all_parameters(xparam_prior,estim_params_,M_);
[~,info,M_,options_,oo_] = resol(0,M_, options_, oo_);
[~,info,M_,oo_] = resol(0,M_, options_, oo_);
indpmodel = estim_params_.param_vals(:,1);
indpstderr = estim_params_.var_exo(:,1);

View File

@ -129,7 +129,7 @@ y0 = [y0; oo_.SmoothedVariables.Mean.(M_.endo_names{endo_iter})(1)];
end;
%make sure decision rules were updated
[oo_.dr,info,M_,options_] = resol(0,M_,options_,oo_);
[oo_.dr,info,M_] = resol(0,M_,options_,oo_);
dr = oo_.dr;
iorder=1;

View File

@ -132,7 +132,7 @@ y0 = [y0; oo_.SmoothedVariables.(M_.endo_names{endo_iter})(1)];
end;
%make sure decision rules were updated
[oo_.dr,info,M_,options_] = resol(0,M_,options_,oo_);
[oo_.dr,info,M_] = resol(0,M_,options_,oo_);
dr = oo_.dr;
iorder=1;

View File

@ -132,7 +132,7 @@ y0 = [y0; oo_.SmoothedVariables.(M_.endo_names{endo_iter})(1)];
end;
%make sure decision rules were updated
[oo_.dr,info,M_,options_] = resol(0,M_,options_,oo_);
[oo_.dr,info,M_] = resol(0,M_,options_,oo_);
dr = oo_.dr;
iorder=1;

View File

@ -146,7 +146,7 @@ y0 = [y0; oo_.SmoothedVariables.Mean.(M_.endo_names{endo_iter})(1)];
end;
%make sure decision rules were updated
[oo_.dr,info,M_,options_] = resol(0,M_,options_,oo_);
[oo_.dr,info,M_] = resol(0,M_,options_,oo_);
dr = oo_.dr;
iorder=1;

View File

@ -95,7 +95,7 @@ calib_smoother(datafile=Data,diffuse_filter);
mf = bayestopt_.smoother_var_list(bayestopt_.smoother_mf);
Q = M_.Sigma_e;
[T,R,SteadyState,info,M_,options_,oo_] = dynare_resolve(M_,options_,oo_);
[T,R,SteadyState,info,M_,oo_] = dynare_resolve(M_,options_,oo_);
[Pstar,Pinf] = compute_Pinf_Pstar(mf,T,R,Q,options_.qz_criterium);