2023-09-15 13:40:10 +02:00
|
|
|
function [A,B,ys,info,dr,params] = dynare_resolve(M_,options_,dr,endo_steady_state,exo_steady_state,exo_det_steady_state,mode)
|
|
|
|
% function [A,B,ys,info,dr,params] = dynare_resolve(M_,options_,dr,endo_steady_state,exo_steady_state,exo_det_steady_state,mode)
|
2011-09-19 12:19:04 +02:00
|
|
|
% Computes the linear approximation and the matrices A and B of the transition equation.
|
2021-06-16 13:17:29 +02:00
|
|
|
%
|
|
|
|
% Inputs:
|
|
|
|
% - M_ [structure] Matlab's structure describing the model
|
|
|
|
% - options_ [structure] Matlab's structure containing the options
|
2023-09-15 13:40:10 +02:00
|
|
|
% - dr [structure] Reduced form model.
|
|
|
|
% - endo_steady_state [vector] steady state value for endogenous variables
|
|
|
|
% - exo_steady_state [vector] steady state value for exogenous variables
|
|
|
|
% - exo_det_steady_state [vector] steady state value for exogenous deterministic variables
|
2021-06-16 13:17:29 +02:00
|
|
|
% - mode [string] if provided, use restricted state space
|
|
|
|
%
|
|
|
|
% Outputs:
|
|
|
|
% - A [double] State transition matrix (potentially for restricted state space)
|
|
|
|
% - B [double] shock impact matrix (potentially for restricted state space)
|
|
|
|
% - ys [double] vector of steady state values
|
|
|
|
% - info [double] 4 by 1 vector with exit flag and information
|
2023-09-15 13:40:10 +02:00
|
|
|
% - dr [structure] Reduced form model.
|
|
|
|
% - params [double] vector of potentially updated parameters
|
2009-12-16 18:17:34 +01:00
|
|
|
|
2023-01-13 16:19:53 +01:00
|
|
|
% Copyright © 2001-2023 Dynare Team
|
2009-12-16 18:17:34 +01:00
|
|
|
%
|
|
|
|
% This file is part of Dynare.
|
|
|
|
%
|
|
|
|
% Dynare is free software: you can redistribute it and/or modify
|
|
|
|
% it under the terms of the GNU General Public License as published by
|
|
|
|
% the Free Software Foundation, either version 3 of the License, or
|
|
|
|
% (at your option) any later version.
|
|
|
|
%
|
|
|
|
% Dynare is distributed in the hope that it will be useful,
|
|
|
|
% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
% GNU General Public License for more details.
|
|
|
|
%
|
|
|
|
% You should have received a copy of the GNU General Public License
|
2021-06-09 17:33:48 +02:00
|
|
|
% along with Dynare. If not, see <https://www.gnu.org/licenses/>.
|
2009-12-16 18:17:34 +01:00
|
|
|
|
2023-09-15 13:40:10 +02:00
|
|
|
[dr,info,params] =compute_decision_rules(M_,options_,dr, endo_steady_state, exo_steady_state, exo_det_steady_state);
|
2009-12-16 18:17:34 +01:00
|
|
|
|
|
|
|
if info(1) > 0
|
|
|
|
A = [];
|
|
|
|
if nargout>1
|
|
|
|
B = [];
|
|
|
|
if nargout>2
|
|
|
|
ys = [];
|
|
|
|
end
|
|
|
|
end
|
|
|
|
return
|
|
|
|
end
|
|
|
|
|
2011-09-22 11:17:31 +02:00
|
|
|
switch nargin
|
2023-09-15 13:40:10 +02:00
|
|
|
case 6
|
2021-06-16 13:17:29 +02:00
|
|
|
endo_nbr = M_.endo_nbr;
|
|
|
|
nstatic = M_.nstatic;
|
|
|
|
nspred = M_.nspred;
|
2009-12-16 18:17:34 +01:00
|
|
|
iv = (1:endo_nbr)';
|
2023-09-15 13:40:10 +02:00
|
|
|
ic = [ nstatic+(1:nspred) endo_nbr+(1:size(dr.ghx,2)-nspred) ]';
|
|
|
|
case 7
|
|
|
|
iv = dr.restrict_var_list;
|
|
|
|
ic = dr.restrict_columns;
|
2011-09-22 11:17:31 +02:00
|
|
|
otherwise
|
|
|
|
error('dynare_resolve:: Error in the calling sequence!')
|
2009-12-16 18:17:34 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
if nargout==1
|
2023-09-15 13:40:10 +02:00
|
|
|
A = kalman_transition_matrix(dr,iv,ic);
|
2009-12-16 18:17:34 +01:00
|
|
|
return
|
|
|
|
end
|
|
|
|
|
2023-09-15 13:40:10 +02:00
|
|
|
[A,B] = kalman_transition_matrix(dr,iv,ic);
|
|
|
|
ys = dr.ys;
|