2008-01-10 15:27:28 +01:00
|
|
|
function steady()
|
|
|
|
% function steady()
|
2008-01-10 15:34:44 +01:00
|
|
|
% computes and prints the steady state calculations
|
2008-01-10 15:27:28 +01:00
|
|
|
%
|
|
|
|
% INPUTS
|
|
|
|
% none
|
|
|
|
%
|
|
|
|
% OUTPUTS
|
|
|
|
% none
|
2005-02-18 20:54:39 +01:00
|
|
|
%
|
2008-01-10 15:27:28 +01:00
|
|
|
% SPECIAL REQUIREMENTS
|
|
|
|
% none
|
|
|
|
|
2012-06-08 18:22:34 +02:00
|
|
|
% Copyright (C) 2001-2012 Dynare Team
|
2008-08-01 14:40:33 +02: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
|
|
|
|
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
|
2005-02-18 20:54:39 +01:00
|
|
|
|
2009-12-16 18:17:34 +01:00
|
|
|
global M_ oo_ options_ ys0_
|
2005-02-18 20:54:39 +01:00
|
|
|
|
2010-11-17 17:09:39 +01:00
|
|
|
test_for_deep_parameters_calibration(M_);
|
|
|
|
|
2009-12-16 18:17:34 +01:00
|
|
|
if options_.steadystate_flag && options_.homotopy_mode
|
2008-03-31 18:19:16 +02:00
|
|
|
error('STEADY: Can''t use homotopy when providing a steady state external file');
|
2009-12-16 18:17:34 +01:00
|
|
|
end
|
|
|
|
|
2011-12-04 23:57:46 +01:00
|
|
|
|
|
|
|
% Keep of a copy of M_.Sigma_e
|
|
|
|
Sigma_e = M_.Sigma_e;
|
|
|
|
|
|
|
|
% Set M_.Sigma_e=0 (we compute the *deterministic* steady state)
|
|
|
|
M_.Sigma_e = zeros(size(Sigma_e));
|
|
|
|
|
2012-05-17 17:05:50 +02:00
|
|
|
info = 0;
|
2009-12-16 18:17:34 +01:00
|
|
|
switch options_.homotopy_mode
|
|
|
|
case 1
|
2012-05-20 08:47:54 +02:00
|
|
|
[M_,oo_,info,ip,ix,ixd] = homotopy1(options_.homotopy_values,options_.homotopy_steps,M_,options_,oo_);
|
2009-12-16 18:17:34 +01:00
|
|
|
case 2
|
|
|
|
homotopy2(options_.homotopy_values, options_.homotopy_steps);
|
|
|
|
case 3
|
2012-05-20 08:47:54 +02:00
|
|
|
[M_,oo_,info,ip,ix,ixd] = homotopy3(options_.homotopy_values,options_.homotopy_steps,M_,options_,oo_);
|
2009-12-16 18:17:34 +01:00
|
|
|
end
|
|
|
|
|
2012-05-17 17:05:50 +02:00
|
|
|
if info(1)
|
|
|
|
hv = options_.homotopy_values;
|
2013-07-10 17:12:34 +02:00
|
|
|
skipline()
|
2012-05-20 08:47:54 +02:00
|
|
|
disp('WARNING: homotopy step was not completed')
|
2012-05-17 17:05:50 +02:00
|
|
|
disp('The last values for which a solution was found are:')
|
|
|
|
for i=1:length(ip)
|
|
|
|
disp(sprintf('%12s %12.6f',M_.param_names(hv(ip(i),2),:), ...
|
2012-11-28 21:30:55 +01:00
|
|
|
M_.params(hv(ip(i),2))))
|
2012-05-17 17:05:50 +02:00
|
|
|
end
|
|
|
|
for i=1:length(ix)
|
|
|
|
disp(sprintf('%12s %12.6f',M_.exo_names(hv(ix(i),2),:), ...
|
2012-11-28 21:30:55 +01:00
|
|
|
oo_.exo_steady_state(hv(ix(i),2))))
|
2012-05-17 17:05:50 +02:00
|
|
|
end
|
|
|
|
for i=1:length(ixd)
|
|
|
|
disp(sprintf('%12s %12.6f',M_.exo_det_names(hv(ixd(i),2),:), ...
|
2012-11-28 21:30:55 +01:00
|
|
|
oo_.exo_det_steady_state(hv(ixd(i),2))))
|
2012-05-17 17:05:50 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
if options_.homotopy_force_continue
|
|
|
|
disp('Option homotopy_continue is set, so I continue ...')
|
|
|
|
else
|
|
|
|
error('Homotopy step failed')
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2012-04-23 16:57:30 +02:00
|
|
|
[steady_state,M_.params,info] = steady_(M_,options_,oo_);
|
2013-08-22 09:47:39 +02:00
|
|
|
oo_.steady_state = steady_state;
|
2011-10-12 21:46:50 +02:00
|
|
|
|
2012-04-23 16:57:30 +02:00
|
|
|
if info(1) == 0
|
2012-05-20 21:36:29 +02:00
|
|
|
if options_.noprint == 0
|
|
|
|
disp_steady_state(M_,oo_);
|
|
|
|
end
|
2012-04-23 16:57:30 +02:00
|
|
|
else
|
2012-05-20 21:36:29 +02:00
|
|
|
if options_.noprint == 0
|
|
|
|
resid;
|
|
|
|
end
|
2013-06-12 10:54:33 +02:00
|
|
|
print_info(info,options_.noprint, options_);
|
2011-10-12 21:46:50 +02:00
|
|
|
end
|
2009-12-16 18:17:34 +01:00
|
|
|
|
2011-12-04 23:57:46 +01:00
|
|
|
M_.Sigma_e = Sigma_e;
|