diff --git a/doc/manual.xml b/doc/manual.xml index 0e304d3a3..ada528efc 100644 --- a/doc/manual.xml +++ b/doc/manual.xml @@ -1822,7 +1822,7 @@ periods 100; For complicated models, finding good numerical initial values for the endogenous variables is the trickiest part of finding the equilibrium of that model. Often, it is better to start with a smaller model and add new variables one by one. - If you know how to compute the steady state for your model, you can provide a MATLAB function doing the computation instead of using steady. The function should be called with the name of the .mod file followed by _steadystate. See fs2000a_steadystate.m in examples/fs2000 directory. + If you know how to compute the steady state for your model, you can provide a MATLAB/Octave function doing the computation instead of using steady. The function should be called with the name of the .mod file followed by _steadystate. See fs2000_steadystate.m in examples directory for an example. @@ -2261,7 +2261,7 @@ steady; stoch_simul computes a Taylor approximation of the decision and transition functions for the model, impulse response functions and various descriptive statistics (moments, variance decomposition, correlation and autocorrelation coefficients). For correlated shocks, the variance decomposition is computed as in the VAR literature through a Cholesky decomposition of the covariance matrix of the exogenous variables. When the shocks are correlated, the variance decomposition depends upon the order of the variables in the command. -The Taylor approximation is computed around the steady state. If you know how to compute the steady state for your model, you can provide a MATLAB/Octave function doing the computation instead of using the nonlinear solver. The function should be called with the name of the .mod file followed by _steadystate. See fs2000a_steadystate.m in examples/fs2000 directory. +The Taylor approximation is computed around the steady state. If you know how to compute the steady state for your model, you can provide a MATLAB/Octave function doing the computation instead of using the nonlinear solver. The function should be called with the name of the .mod file followed by _steadystate. See fs2000_steadystate.m in examples directory for an example. The IRFs are computed as the difference between the trajectory of a variable following a shock at the beginning of period 1 and its steady state value. @@ -3460,7 +3460,7 @@ oo_.posterior_hpdsup.measurement_errors_corr.gdp_conso Note on steady state computation -If you know how to compute the steady state for your model, you can provide a MATLAB function doing the computation instead of using steady. The function should be called with the name of the .mod file followed by _steadystate. See fs2000a_steadystate.m in examples/fs2000 directory. +If you know how to compute the steady state for your model, you can provide a MATLAB/Octave function doing the computation instead of using steady. The function should be called with the name of the .mod file followed by _steadystate. See fs2000_steadystate.m in examples directory for an example. @@ -3565,7 +3565,7 @@ oo_.posterior_hpdsup.measurement_errors_corr.gdp_conso When unit_root_vars is used the option of has no effect. - When there are nonstationary variables in a model, there is no unique deterministic steady state. The user must supply a MATLAB function that computes the steady state values of the stationary variables in the model and returns dummy values for the nonstationary ones. The function should be called with the name of the .mod file followed by _steadystate. See fs2000a_steadystate.m in examples/fs2000 directory. + When there are nonstationary variables in a model, there is no unique deterministic steady state. The user must supply a MATLAB/Octave function that computes the steady state values of the stationary variables in the model and returns dummy values for the nonstationary ones. The function should be called with the name of the .mod file followed by _steadystate. See fs2000_steadystate.m in examples directory for an example. Note that the nonstationary variables in the model must be integrated processes(their first difference or k-difference must be stationary). diff --git a/examples/fs2000_steadystate.m b/examples/fs2000_steadystate.m new file mode 100644 index 000000000..2ac140da5 --- /dev/null +++ b/examples/fs2000_steadystate.m @@ -0,0 +1,73 @@ +% computes the steady state of fs2000 analyticaly +% largely inspired by the program of F. Schorfheide + +% Copyright (C) 2004-2010 Dynare Team +% +% 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 . + +function [ys,check] = fs2000_steadystate(ys,exe) + global M_ + + alp = M_.params(1); + bet = M_.params(2); + gam = M_.params(3); + mst = M_.params(4); + rho = M_.params(5); + psi = M_.params(6); + del = M_.params(7); + + check = 0; + + dA = exp(gam); + gst = 1/dA; + m = mst; + + khst = ( (1-gst*bet*(1-del)) / (alp*gst^alp*bet) )^(1/(alp-1)); + xist = ( ((khst*gst)^alp - (1-gst*(1-del))*khst)/mst )^(-1); + nust = psi*mst^2/( (1-alp)*(1-psi)*bet*gst^alp*khst^alp ); + n = xist/(nust+xist); + P = xist + nust; + k = khst*n; + + l = psi*mst*n/( (1-psi)*(1-n) ); + c = mst/P; + d = l - mst + 1; + y = k^alp*n^(1-alp)*gst^alp; + R = mst/bet; + W = l/n; + ist = y-c; + q = 1 - d; + + e = 1; + + gp_obs = m/dA; + gy_obs = dA; + + ys =[ +m +P +c +e +W +R +k +d +n +l +gy_obs +gp_obs +y +dA ];