2006-09-17 17:23:45 +02:00
|
|
|
function [A,B,ys,info] = dynare_resolve(iv,ic,aux)
|
2008-01-28 15:46:20 +01:00
|
|
|
|
|
|
|
% function [A,B,ys,info] = dynare_resolve(iv,ic,aux)
|
|
|
|
% 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
|
|
|
|
%
|
|
|
|
% OUTPUTS
|
|
|
|
% A: matrix of predetermined variables effects in linear solution (ghx)
|
|
|
|
% B: matrix of shocks effects in linear solution (ghu)
|
|
|
|
% ys: steady state of original endogenous variables
|
|
|
|
% info=1: the model doesn't determine the current variables '...' uniquely
|
|
|
|
% info=2: MJDGGES returns the following error code'
|
|
|
|
% info=3: Blanchard Kahn conditions are not satisfied: no stable '...' equilibrium
|
|
|
|
% info=4: Blanchard Kahn conditions are not satisfied:'...' indeterminacy
|
|
|
|
% info=5: Blanchard Kahn conditions are not satisfied:'...' indeterminacy due to rank failure
|
|
|
|
% info=11: same as dr1 for dr_algo = 2
|
|
|
|
% info=20: can't find steady state info(2) contains sum of sqare residuals
|
|
|
|
% info=30: variance can't be computed
|
|
|
|
%
|
|
|
|
% SPECIAL REQUIREMENTS
|
|
|
|
% none
|
|
|
|
%
|
|
|
|
% part of DYNARE, copyright Dynare Team (2003-2007)
|
|
|
|
% Gnu Public License.
|
|
|
|
|
|
|
|
|
2006-09-17 17:23:45 +02:00
|
|
|
global oo_ M_
|
2006-01-08 09:39:00 +01:00
|
|
|
|
2006-01-18 17:50:33 +01:00
|
|
|
[oo_.dr,info] = resol(oo_.steady_state,0);
|
2008-06-21 10:33:31 +02:00
|
|
|
|
2006-01-08 09:39:00 +01:00
|
|
|
if info(1) > 0
|
|
|
|
A = [];
|
|
|
|
B = [];
|
|
|
|
ys = [];
|
|
|
|
return
|
|
|
|
end
|
|
|
|
|
2006-09-17 17:23:45 +02:00
|
|
|
if nargin == 0
|
|
|
|
endo_nbr = M_.endo_nbr;
|
2006-09-18 21:36:10 +02:00
|
|
|
nstatic = oo_.dr.nstatic;
|
|
|
|
npred = oo_.dr.npred;
|
2006-09-17 17:23:45 +02:00
|
|
|
iv = (1:endo_nbr)';
|
2006-09-18 21:36:10 +02:00
|
|
|
ic = [ nstatic+(1:npred) endo_nbr+(1:size(oo_.dr.ghx,2)-npred) ]';
|
2006-09-28 09:33:40 +02:00
|
|
|
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;
|
2006-09-17 17:23:45 +02:00
|
|
|
end
|
|
|
|
|
2008-06-21 10:33:31 +02:00
|
|
|
[A,B] = kalman_transition_matrix(oo_.dr,iv,ic,aux,M_.exo_nbr);
|
2006-01-18 17:50:33 +01:00
|
|
|
ys = oo_.dr.ys;
|