


Add auxiliary variables to the steady state vector


0001 function ys1 = add_auxiliary_variables_to_steadystate(ys,aux_vars,fname, ... 0002 exo_steady_state, exo_det_steady_state,params, byte_code) 0003 % Add auxiliary variables to the steady state vector 0004 0005 % Copyright (C) 2009-2011 Dynare Team 0006 % 0007 % This file is part of Dynare. 0008 % 0009 % Dynare is free software: you can redistribute it and/or modify 0010 % it under the terms of the GNU General Public License as published by 0011 % the Free Software Foundation, either version 3 of the License, or 0012 % (at your option) any later version. 0013 % 0014 % Dynare is distributed in the hope that it will be useful, 0015 % but WITHOUT ANY WARRANTY; without even the implied warranty of 0016 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 0017 % GNU General Public License for more details. 0018 % 0019 % You should have received a copy of the GNU General Public License 0020 % along with Dynare. If not, see <http://www.gnu.org/licenses/>. 0021 n = length(aux_vars); 0022 ys1 = [ys;zeros(n,1)]; 0023 0024 for i=1:n+1; 0025 if byte_code 0026 [info, res] = bytecode('static','evaluate',ys1,... 0027 [exo_steady_state; ... 0028 exo_det_steady_state],params); 0029 else 0030 res = feval([fname '_static'],ys1,... 0031 [exo_steady_state; ... 0032 exo_det_steady_state],params); 0033 end; 0034 for j=1:n 0035 el = aux_vars(j).endo_index; 0036 ys1(el) = ys1(el)-res(el); 0037 end 0038 end