Unverified Commit f7a23206 authored by Johannes Pfeifer 's avatar Johannes Pfeifer Committed by Sébastien Villemot
Browse files

Remove unused options_-output

Prevents accidentally changing something
parent 7d57bd0e
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
......
......@@ -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;
......
......@@ -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);
......
......@@ -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
......
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
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
......
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
......
......@@ -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
......
......@@ -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;
......
......@@ -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);
......
......@@ -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);
......
......@@ -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);
......
......@@ -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)
......
......@@ -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
......
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 = [];
......
......@@ -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
......
......@@ -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;
......
......@@ -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)
......
......@@ -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);
......
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment