


Computes the linear approximation and the matrices A and B of the transition equation.


0001 function [A,B,ys,info,Model,DynareOptions,DynareResults] = dynare_resolve(Model,DynareOptions,DynareResults,mode) 0002 % Computes the linear approximation and the matrices A and B of the transition equation. 0003 0004 %@info: 0005 %! @deftypefn {Function File} {[@var{A},@var{B},@var{ys},@var{info},@var{Model},@var{DynareOptions},@var{DynareResults}] =} resol (@var{Model},@var{DynareOptions},@var{DynareResults}) 0006 %! @anchor{dynare_resolve} 0007 %! @sp 1 0008 %! Computes the linear approximation and the matrices A and B of the transition equation. 0009 %! @sp 2 0010 %! @strong{Inputs} 0011 %! @sp 1 0012 %! @table @ @var 0013 %! @item check_flag 0014 %! Integer scalar, equal to 0 if all the approximation is required, positive if only the eigenvalues are to be computed. 0015 %! @item Model 0016 %! Matlab's structure describing the model (initialized by dynare, see @ref{M_}). 0017 %! @item DynareOptions 0018 %! Matlab's structure describing the options (initialized by dynare, see @ref{options_}). 0019 %! @item DynareResults 0020 %! Matlab's structure gathering the results (initialized by dynare, see @ref{oo_}). 0021 %! @end table 0022 %! @sp 2 0023 %! @strong{Outputs} 0024 %! @sp 1 0025 %! @table @ @var 0026 %! @item A 0027 %! Matrix of doubles, transition matrix of the state equation. 0028 %! @item B 0029 %! Matrix of doubles, matrix relating the endogenous variables to the innovations in the state equation. 0030 %! @item ys 0031 %! Vector of doubles, steady state level of the endogenous variables in the state equation. 0032 %! @item info 0033 %! Integer scalar, error code as given by @ref{resol}. 0034 %! @item Model 0035 %! Matlab's structure describing the model (initialized by dynare, see @ref{M_}). 0036 %! @item DynareOptions 0037 %! Matlab's structure describing the options (initialized by dynare, see @ref{options_}). 0038 %! @item DynareResults 0039 %! Matlab's structure gathering the results (initialized by dynare, see @ref{oo_}). 0040 %! @end table 0041 %! @sp 2 0042 %! @strong{This function is called by:} 0043 %! @sp 1 0044 %! @ref{dsge_likelihood}, @ref{DsgeLikelihood_hh}, @ref{DsgeVarLikelihood}, @ref{dsge_posterior_kernel}, @ref{DsgeSmoother}, @ref{dynare_sensitivity}, @ref{gsa/thet2tau}, @ref{gsa/stab_map}, @ref{identification_analysis}, @ref{imcforecast}, @ref{thet2tau} 0045 %! @sp 2 0046 %! @strong{This function calls:} 0047 %! @sp 1 0048 %! @ref{resol}, @ref{kalman_transition_matrix} 0049 %! @end deftypefn 0050 %@eod: 0051 0052 % Copyright (C) 2001-2011 Dynare Team 0053 % 0054 % This file is part of Dynare. 0055 % 0056 % Dynare is free software: you can redistribute it and/or modify 0057 % it under the terms of the GNU General Public License as published by 0058 % the Free Software Foundation, either version 3 of the License, or 0059 % (at your option) any later version. 0060 % 0061 % Dynare is distributed in the hope that it will be useful, 0062 % but WITHOUT ANY WARRANTY; without even the implied warranty of 0063 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 0064 % GNU General Public License for more details. 0065 % 0066 % You should have received a copy of the GNU General Public License 0067 % along with Dynare. If not, see <http://www.gnu.org/licenses/>. 0068 0069 [dr,info,Model,DynareOptions,DynareResults] = resol(0,Model,DynareOptions,DynareResults); 0070 DynareResults.dr = dr; 0071 0072 if info(1) > 0 0073 A = []; 0074 if nargout>1 0075 B = []; 0076 if nargout>2 0077 ys = []; 0078 end 0079 end 0080 return 0081 end 0082 0083 switch nargin 0084 case 3 0085 endo_nbr = Model.endo_nbr; 0086 nstatic = DynareResults.dr.nstatic; 0087 npred = DynareResults.dr.npred; 0088 iv = (1:endo_nbr)'; 0089 if DynareOptions.block == 0 0090 ic = [ nstatic+(1:npred) endo_nbr+(1:size(DynareResults.dr.ghx,2)-npred) ]'; 0091 else 0092 ic = DynareResults.dr.restrict_columns; 0093 end; 0094 case 4 0095 iv = DynareResults.dr.restrict_var_list; 0096 ic = DynareResults.dr.restrict_columns; 0097 otherwise 0098 error('dynare_resolve:: Error in the calling sequence!') 0099 end 0100 0101 if nargout==1 0102 A = kalman_transition_matrix(DynareResults.dr,iv,ic,Model.exo_nbr); 0103 return 0104 end 0105 0106 [A,B] = kalman_transition_matrix(DynareResults.dr,iv,ic,Model.exo_nbr); 0107 ys = DynareResults.dr.ys;