Commit bff8de83 authored by Michel Juillard's avatar Michel Juillard
Browse files

modifying dynare_resolve() calling sequence

parent a336799b
......@@ -124,9 +124,8 @@ M_.H = H;
%------------------------------------------------------------------------------
% 2. call model setup & reduction program
%------------------------------------------------------------------------------
[T,R,SteadyState,info] = dynare_resolve(bayestopt_.restrict_var_list,...
bayestopt_.restrict_columns,...
bayestopt_.restrict_aux);
[T,R,SteadyState,info] = dynare_resolve('restrict');
if info(1) == 1 || info(1) == 2 || info(1) == 5
fval = bayestopt_.penalty+1;
cost_flag = 0;
......
......@@ -125,9 +125,7 @@ function [fval,llik,cost_flag,ys,trend_coeff,info] = DsgeLikelihood(xparam1,gend
%------------------------------------------------------------------------------
% 2. call model setup & reduction program
%------------------------------------------------------------------------------
[T,R,SteadyState,info] = dynare_resolve(bayestopt_.restrict_var_list,...
bayestopt_.restrict_columns,...
bayestopt_.restrict_aux);
[T,R,SteadyState,info] = dynare_resolve('restrict');
if info(1) == 1 || info(1) == 2 || info(1) == 5
fval = bayestopt_.penalty+1;
cost_flag = 0;
......
......@@ -67,8 +67,10 @@ set_all_parameters(xparam1);
%------------------------------------------------------------------------------
% 2. call model setup & reduction program
%------------------------------------------------------------------------------
[T,R,SteadyState] = dynare_resolve(bayestopt_.smoother_var_list,...
bayestopt_.smoother_restrict_columns,[]);
oo_.dr.restrict_var_list = bayestopt_.smoother_var_list;
oo_.dr.restrict_columns = bayestopt_.smoother_restrict_columns;
[T,R,SteadyState] = dynare_resolve('restrict');
bayestopt_.mf = bayestopt_.smoother_mf;
if options_.noconstant
constant = zeros(nobs,1);
......
......@@ -106,9 +106,8 @@ end
%------------------------------------------------------------------------------
% 2. call model setup & reduction program
%------------------------------------------------------------------------------
[T,R,SteadyState,info] = dynare_resolve(bayestopt_.restrict_var_list,...
bayestopt_.restrict_columns,...
bayestopt_.restrict_aux);
[T,R,SteadyState,info] = dynare_resolve('restrict');
if info(1) == 1 || info(1) == 2 || info(1) == 5
fval = bayestopt_.penalty+1;
cost_flag = 0;
......
......@@ -124,9 +124,7 @@ M_.H = H;
%------------------------------------------------------------------------------
% 2. call model setup & reduction program
%------------------------------------------------------------------------------
[T,R,SteadyState,info] = dynare_resolve(bayestopt_.restrict_var_list,...
bayestopt_.restrict_columns,...
bayestopt_.restrict_aux);
[T,R,SteadyState,info] = dynare_resolve('restrict');
if info(1) == 1 | info(1) == 2 | info(1) == 5
fval = bayestopt_.penalty+1;
cost_flag = 0;
......
function [A,B,ys,info] = dynare_resolve(iv,ic,aux)
% function [A,B,ys,info] = dynare_resolve(iv,ic,aux)
function [A,B,ys,info] = dynare_resolve(mode)
% function [A,B,ys,info] = dynare_resolve(mode)
% Computes the linear approximation and the matrices A and B of the
% transition equation
%
% INPUTS
% iv: selected variables (observed and state variables)
% ic: state variables position in the transition matrix columns
% aux: indices for auxiliary equations
% mode: string 'restrict' returns restricted transition matrices
%
% OUTPUTS
% A: matrix of predetermined variables effects in linear solution (ghx)
......@@ -61,16 +59,15 @@ if nargin == 0
npred = oo_.dr.npred;
iv = (1:endo_nbr)';
ic = [ nstatic+(1:npred) endo_nbr+(1:size(oo_.dr.ghx,2)-npred) ]';
aux = oo_.dr.transition_auxiliary_variables;
k = find(aux(:,2) > npred);
aux(:,2) = aux(:,2) + nstatic;
aux(k,2) = aux(k,2) + oo_.dr.nfwrd;
else
iv = oo_.dr.restrict_var_list;
ic = oo_.dr.restrict_columns;
end
if nargout==1
A = kalman_transition_matrix(oo_.dr,iv,ic,aux,M_.exo_nbr);
A = kalman_transition_matrix(oo_.dr,iv,ic,M_.exo_nbr);
return
end
[A,B] = kalman_transition_matrix(oo_.dr,iv,ic,aux,M_.exo_nbr);
[A,B] = kalman_transition_matrix(oo_.dr,iv,ic,M_.exo_nbr);
ys = oo_.dr.ys;
\ No newline at end of file
Supports Markdown
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