2023-10-25 17:29:55 +02:00
|
|
|
function [residuals,check1,jacob] = evaluate_static_model(ys,exo_ss,params,M_,options_)
|
2011-10-12 21:46:50 +02:00
|
|
|
|
2023-10-25 17:29:55 +02:00
|
|
|
% function [residuals,check1,jacob] = evaluate_static_model(ys,exo_ss,params,M_,options_)
|
2016-03-25 20:20:28 +01:00
|
|
|
% Evaluates the static model
|
2017-05-16 15:10:20 +02:00
|
|
|
%
|
2011-10-12 21:46:50 +02:00
|
|
|
% INPUTS
|
|
|
|
% ys vector initial values used to compute the steady
|
|
|
|
% state
|
|
|
|
% exo_ss vector exogenous steady state
|
|
|
|
% params vector parameters
|
2023-10-25 17:29:55 +02:00
|
|
|
% M_ struct model structure
|
|
|
|
% options_ struct options
|
2017-05-16 15:10:20 +02:00
|
|
|
%
|
2011-10-12 21:46:50 +02:00
|
|
|
% OUTPUTS
|
|
|
|
% residuals vector residuals when ys is not
|
|
|
|
% the steady state
|
|
|
|
% check1 scalar error flag
|
|
|
|
% jacob matrix Jacobian of static model
|
|
|
|
%
|
|
|
|
% SPECIAL REQUIREMENTS
|
|
|
|
% none
|
|
|
|
|
2023-01-10 16:05:33 +01:00
|
|
|
% Copyright © 2001-2023 Dynare Team
|
2011-10-12 21:46:50 +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
|
2021-06-09 17:33:48 +02:00
|
|
|
% along with Dynare. If not, see <https://www.gnu.org/licenses/>.
|
2011-10-12 21:46:50 +02:00
|
|
|
|
2017-05-16 15:10:20 +02:00
|
|
|
check1 = 0;
|
2023-10-25 17:29:55 +02:00
|
|
|
if options_.bytecode
|
2021-11-08 14:31:24 +01:00
|
|
|
if nargout<3
|
2023-10-25 17:29:55 +02:00
|
|
|
[residuals]= bytecode('evaluate', 'static', M_, options_, ys, ...
|
2020-01-10 17:55:57 +01:00
|
|
|
exo_ss, params, ys, 1);
|
2021-11-08 14:31:24 +01:00
|
|
|
else
|
2023-10-25 17:29:55 +02:00
|
|
|
[residuals, junk]= bytecode('evaluate', 'static', M_, options_, ys, ...
|
2021-11-08 14:31:24 +01:00
|
|
|
exo_ss, params, ys, 1);
|
|
|
|
jacob = junk.g1;
|
|
|
|
end
|
2017-05-16 15:10:20 +02:00
|
|
|
else
|
2023-10-25 17:29:55 +02:00
|
|
|
[residuals, T_order, T] = feval([M_.fname '.sparse.static_resid'], ys, exo_ss, params);
|
2023-01-10 16:05:33 +01:00
|
|
|
if nargout >= 3
|
2023-10-25 17:29:55 +02:00
|
|
|
jacob = feval([M_.fname '.sparse.static_g1'], ys, exo_ss, params, M_.static_g1_sparse_rowval, M_.static_g1_sparse_colval, M_.static_g1_sparse_colptr, T_order, T);
|
2011-10-12 21:46:50 +02:00
|
|
|
end
|
2017-05-16 15:10:20 +02:00
|
|
|
end
|