


@info:
! @deftypefn {Function File} {[@var{dr},@var{info},@var{M},@var{options},@var{oo}] =} resol (@var{check_flag},@var{M},@var{options},@var{oo})
! @anchor{resol}
! @sp 1
! Computes first and second order reduced form of the DSGE model.
! @sp 2
! @strong{Inputs}
! @sp 1
! @table @ @var
! @item check_flag
! Integer scalar, equal to 0 if all the approximation is required, positive if only the eigenvalues are to be computed.
! @item M
! Matlab's structure describing the model (initialized by @code{dynare}).
! @item options
! Matlab's structure describing the options (initialized by @code{dynare}).
! @item oo
! Matlab's structure gathering the results (initialized by @code{dynare}).
! @end table
! @sp 2
! @strong{Outputs}
! @sp 1
! @table @ @var
! @item dr
! Matlab's structure describing the reduced form solution of the model.
! @item info
! Integer scalar, error code.
! @sp 1
! @table @ @code
! @item info==0
! No error.
! @item info==1
! The model doesn't determine the current variables uniquely.
! @item info==2
! MJDGGES returned an error code.
! @item info==3
! Blanchard & Kahn conditions are not satisfied: no stable equilibrium.
! @item info==4
! Blanchard & Kahn conditions are not satisfied: indeterminacy.
! @item info==5
! Blanchard & Kahn conditions are not satisfied: indeterminacy due to rank failure.
! @item info==6
! The jacobian evaluated at the deterministic steady state is complex.
! @item info==19
! The steadystate routine thrown an exception (inconsistent deep parameters).
! @item info==20
! Cannot find the steady state, info(2) contains the sum of square residuals (of the static equations).
! @item info==21
! The steady state is complex, info(2) contains the sum of square of imaginary parts of the steady state.
! @item info==22
! The steady has NaNs.
! @item info==23
! M_.params has been updated in the steadystate routine and has complex valued scalars.
! @item info==24
! M_.params has been updated in the steadystate routine and has some NaNs.
! @item info==30
! Ergodic variance can't be computed.
! @end table
! @sp 1
! @item M
! Matlab's structure describing the model (initialized by @code{dynare}).
! @item options
! Matlab's structure describing the options (initialized by @code{dynare}).
! @item oo
! Matlab's structure gathering the results (initialized by @code{dynare}).
! @end table
! @sp 2
! @strong{This function is called by:}
! @sp 1
! @ref{dynare_estimation_init}
! @sp 2
! @strong{This function calls:}
! @sp 1
! None.
! @end deftypefn
@eod:

0001 function [dr,info,M,options,oo] = resol(check_flag,M,options,oo) 0002 0003 %@info: 0004 %! @deftypefn {Function File} {[@var{dr},@var{info},@var{M},@var{options},@var{oo}] =} resol (@var{check_flag},@var{M},@var{options},@var{oo}) 0005 %! @anchor{resol} 0006 %! @sp 1 0007 %! Computes first and second order reduced form of the DSGE model. 0008 %! @sp 2 0009 %! @strong{Inputs} 0010 %! @sp 1 0011 %! @table @ @var 0012 %! @item check_flag 0013 %! Integer scalar, equal to 0 if all the approximation is required, positive if only the eigenvalues are to be computed. 0014 %! @item M 0015 %! Matlab's structure describing the model (initialized by @code{dynare}). 0016 %! @item options 0017 %! Matlab's structure describing the options (initialized by @code{dynare}). 0018 %! @item oo 0019 %! Matlab's structure gathering the results (initialized by @code{dynare}). 0020 %! @end table 0021 %! @sp 2 0022 %! @strong{Outputs} 0023 %! @sp 1 0024 %! @table @ @var 0025 %! @item dr 0026 %! Matlab's structure describing the reduced form solution of the model. 0027 %! @item info 0028 %! Integer scalar, error code. 0029 %! @sp 1 0030 %! @table @ @code 0031 %! @item info==0 0032 %! No error. 0033 %! @item info==1 0034 %! The model doesn't determine the current variables uniquely. 0035 %! @item info==2 0036 %! MJDGGES returned an error code. 0037 %! @item info==3 0038 %! Blanchard & Kahn conditions are not satisfied: no stable equilibrium. 0039 %! @item info==4 0040 %! Blanchard & Kahn conditions are not satisfied: indeterminacy. 0041 %! @item info==5 0042 %! Blanchard & Kahn conditions are not satisfied: indeterminacy due to rank failure. 0043 %! @item info==6 0044 %! The jacobian evaluated at the deterministic steady state is complex. 0045 %! @item info==19 0046 %! The steadystate routine thrown an exception (inconsistent deep parameters). 0047 %! @item info==20 0048 %! Cannot find the steady state, info(2) contains the sum of square residuals (of the static equations). 0049 %! @item info==21 0050 %! The steady state is complex, info(2) contains the sum of square of imaginary parts of the steady state. 0051 %! @item info==22 0052 %! The steady has NaNs. 0053 %! @item info==23 0054 %! M_.params has been updated in the steadystate routine and has complex valued scalars. 0055 %! @item info==24 0056 %! M_.params has been updated in the steadystate routine and has some NaNs. 0057 %! @item info==30 0058 %! Ergodic variance can't be computed. 0059 %! @end table 0060 %! @sp 1 0061 %! @item M 0062 %! Matlab's structure describing the model (initialized by @code{dynare}). 0063 %! @item options 0064 %! Matlab's structure describing the options (initialized by @code{dynare}). 0065 %! @item oo 0066 %! Matlab's structure gathering the results (initialized by @code{dynare}). 0067 %! @end table 0068 %! @sp 2 0069 %! @strong{This function is called by:} 0070 %! @sp 1 0071 %! @ref{dynare_estimation_init} 0072 %! @sp 2 0073 %! @strong{This function calls:} 0074 %! @sp 1 0075 %! None. 0076 %! @end deftypefn 0077 %@eod: 0078 0079 % Copyright (C) 2001-2011 Dynare Team 0080 % 0081 % This file is part of Dynare. 0082 % 0083 % Dynare is free software: you can redistribute it and/or modify 0084 % it under the terms of the GNU General Public License as published by 0085 % the Free Software Foundation, either version 3 of the License, or 0086 % (at your option) any later version. 0087 % 0088 % Dynare is distributed in the hope that it will be useful, 0089 % but WITHOUT ANY WARRANTY; without even the implied warranty of 0090 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 0091 % GNU General Public License for more details. 0092 % 0093 % You should have received a copy of the GNU General Public License 0094 % along with Dynare. If not, see <http://www.gnu.org/licenses/>. 0095 0096 if isfield(oo,'dr'); 0097 dr = oo.dr; 0098 end 0099 0100 info = 0; 0101 0102 it_ = M.maximum_lag + 1 ; 0103 0104 if M.exo_nbr == 0 0105 oo.exo_steady_state = [] ; 0106 end 0107 0108 [dr.ys,M.params,info] = evaluate_steady_state(oo.steady_state,M,options,oo,0); 0109 0110 if info(1) 0111 return 0112 end 0113 0114 if options.block 0115 [dr,info,M,options,oo] = dr_block(dr,check_flag,M,options,oo); 0116 else 0117 [dr,info] = stochastic_solvers(dr,check_flag,M,options,oo); 0118 oo.dr = dr; 0119 end 0120 0121