2008-01-10 15:29:29 +01:00
|
|
|
|
2005-02-18 20:54:39 +01:00
|
|
|
function steady_()
|
|
|
|
|
2008-01-10 15:29:29 +01:00
|
|
|
% function steady_()
|
|
|
|
% computes the steady state
|
|
|
|
%
|
|
|
|
% INPUTS
|
|
|
|
% none
|
|
|
|
%
|
|
|
|
% OUTPUTS
|
|
|
|
% none
|
|
|
|
%
|
|
|
|
% SPECIAL REQUIREMENTS
|
|
|
|
% none
|
|
|
|
%
|
|
|
|
% part of DYNARE, copyright Dynare Team (2001-2007)
|
|
|
|
% Gnu Public License.
|
|
|
|
|
2006-06-02 09:42:00 +02:00
|
|
|
global M_ oo_ it_ options_
|
2007-02-09 17:30:47 +01:00
|
|
|
|
|
|
|
|
2006-07-17 10:47:30 +02:00
|
|
|
if options_.steadystate_flag
|
2006-06-02 09:42:00 +02:00
|
|
|
[oo_.steady_state,check] = feval([M_.fname '_steadystate'],...
|
|
|
|
oo_.steady_state,...
|
|
|
|
[oo_.exo_steady_state; ...
|
|
|
|
oo_.exo_det_steady_state]);
|
2006-09-15 16:16:34 +02:00
|
|
|
% Check if the steady state obtained from the _steadystate file is a
|
|
|
|
% steady state.
|
2007-09-29 10:20:06 +02:00
|
|
|
check1 = 0;
|
2006-09-17 17:21:22 +02:00
|
|
|
if isfield(options_,'unit_root_vars')
|
|
|
|
if isempty(options_.unit_root_vars)
|
2007-09-29 10:20:06 +02:00
|
|
|
check1 = max(abs(feval([M_.fname '_static'],...
|
2006-09-17 17:21:22 +02:00
|
|
|
oo_.steady_state,...
|
|
|
|
[oo_.exo_steady_state; ...
|
2008-06-06 16:01:02 +02:00
|
|
|
oo_.exo_det_steady_state], M_.params))) > options_.dynatol ;
|
2007-09-29 10:20:06 +02:00
|
|
|
if check1
|
|
|
|
error(['The seadystate values returned by ' M_.fname ...
|
|
|
|
'_steadystate.m don''t solve the static model!' ])
|
|
|
|
end
|
2006-09-17 17:21:22 +02:00
|
|
|
end
|
|
|
|
end
|
2006-09-15 16:16:34 +02:00
|
|
|
if ~isempty(options_.steadystate_partial)
|
2006-09-17 17:21:22 +02:00
|
|
|
ssvar = options_.steadystate_partial.ssvar;
|
|
|
|
nov = length(ssvar);
|
|
|
|
indv = zeros(nov,1);
|
|
|
|
for i = 1:nov
|
|
|
|
indv(i) = strmatch(ssvar(i),M_.endo_names,'exact');
|
|
|
|
end
|
|
|
|
[oo_.steady_state,check] = dynare_solve('restricted_steadystate',...
|
|
|
|
oo_.steady_state(indv),...
|
|
|
|
options_.jacobian_flag, ...
|
|
|
|
[oo_.exo_steady_state;oo_.exo_det_steady_state],indv);
|
2006-09-15 16:16:34 +02:00
|
|
|
end
|
2006-01-08 09:39:00 +01:00
|
|
|
else
|
2006-06-02 09:42:00 +02:00
|
|
|
[oo_.steady_state,check] = dynare_solve([M_.fname '_static'],...
|
|
|
|
oo_.steady_state,...
|
|
|
|
options_.jacobian_flag, ...
|
|
|
|
[oo_.exo_steady_state; ...
|
2008-06-06 16:01:02 +02:00
|
|
|
oo_.exo_det_steady_state], M_.params);
|
2006-01-08 09:39:00 +01:00
|
|
|
end
|
2005-02-18 20:54:39 +01:00
|
|
|
|
2006-01-08 09:39:00 +01:00
|
|
|
if check ~= 0
|
2005-02-18 20:54:39 +01:00
|
|
|
error('STEADY: convergence problems')
|
2006-09-15 16:16:34 +02:00
|
|
|
end
|