v4.1: removed error when a variable isn't present at the current period in the model

modified header


git-svn-id: https://www.dynare.org/svn/dynare/trunk@2523 ac1d8469-bf42-47a9-8791-bf33cf982152
time-shift
michel 2009-03-26 09:32:58 +00:00
parent ff473fedfd
commit 558dd91156
1 changed files with 8 additions and 5 deletions

View File

@ -1,5 +1,6 @@
function [dr,info,M_,options_,oo_] = dr1(dr,task,M_,options_,oo_) function [dr,info,M_,options_,oo_] = dr1(dr,task,M_,options_,oo_)
% Computes the reduced form solution of a rational expectation model (first or second order % function [dr,info,M_,options_,oo_] = dr1(dr,task,M_,options_,oo_)
% computes the reduced form solution of a rational expectation model (first or second order
% approximation of the stochastic model around the deterministic steady state). % approximation of the stochastic model around the deterministic steady state).
% %
% INPUTS % INPUTS
@ -31,7 +32,7 @@ function [dr,info,M_,options_,oo_] = dr1(dr,task,M_,options_,oo_)
% none. % none.
% %
% Copyright (C) 1996-2008 Dynare Team % Copyright (C) 1996-2009 Dynare Team
% %
% This file is part of Dynare. % This file is part of Dynare.
% %
@ -229,8 +230,10 @@ function [dr,info,M_,options_,oo_] = dr1(dr,task,M_,options_,oo_)
sdyn = M_.endo_nbr - nstatic; sdyn = M_.endo_nbr - nstatic;
k0 = M_.lead_lag_incidence(M_.maximum_endo_lag+1,order_var); [junk,cols_b,cols_j] = find(M_.lead_lag_incidence(M_.maximum_endo_lag+1, ...
b = jacobia_(:,k0); order_var));
b = zeros(M_.endo_nbr,M_.endo_nbr);
b(:,cols_b) = jacobia_(:,cols_j);
if M_.maximum_endo_lead == 0; % backward models if M_.maximum_endo_lead == 0; % backward models
% If required, try Gary Anderson and G Moore AIM solver if not % If required, try Gary Anderson and G Moore AIM solver if not
@ -326,7 +329,7 @@ function [dr,info,M_,options_,oo_] = dr1(dr,task,M_,options_,oo_)
if ~((options_.useAIM == 1)&& (task == 0) && (options_.order == 1)) % || isempty(options_.useAIM) if ~((options_.useAIM == 1)&& (task == 0) && (options_.order == 1)) % || isempty(options_.useAIM)
k1 = M_.lead_lag_incidence(find([1:klen] ~= M_.maximum_endo_lag+1),:); k1 = M_.lead_lag_incidence(find([1:klen] ~= M_.maximum_endo_lag+1),:);
a = aa(:,nonzeros(k1')); a = aa(:,nonzeros(k1'));
b = aa(:,k0); b(:,cols_b) = aa(:,cols_j);
b10 = b(1:nstatic,1:nstatic); b10 = b(1:nstatic,1:nstatic);
b11 = b(1:nstatic,nstatic+1:end); b11 = b(1:nstatic,nstatic+1:end);
b2 = b(nstatic+1:end,nstatic+1:end); b2 = b(nstatic+1:end,nstatic+1:end);