The main notes for this section are found in DSGE2013.pdf.
There is also a supplementary file in DSGE2013extra.pdf.
The homework associated with this section can be found in Econ_Week2.pdf.
You will need the python version of Uhlig’s toolkit. It can be found in uhlig.py.
Below we will show the documentation for it.
Python module for using the method outlined by Uhlig (1997) to solve a loglinearized RBC model for policy functions.
Original adaptation of MATLAB code done by Spencer Lyon in May 2012
Additional work has been done by Chase Coleman
This function mimics the behavior of Harald Uhlig’s solve.m and calc_qrs.m files in Uhlig’s toolkit.
In order to use this function, the user must have loglinearized the model they are dealing with to be in the following form (assume that y corresponds to the model’s “jump variables”, z represents the exogenous state variables and x is for endogenous state variables. nx, ny, nz correspond to the number of variables in each category.) The inputs to this function are the matrices found in the following equations.
The purpose of this function is to find the recursive equilibrium law of motion defined by the following equations.
Following outline given in Uhhlig (1997), we solve for \(P\) and \(Q\) using the following set of equations:
Once \(P\) and \(Q\) are known, one ca solve for \(R\) and \(S\) using the following equations:
Parameters :  AA : array_like, dtype=float, shape=(ny, nx)
BB : array_like, dtype=float, shape=(ny, nx)
CC : array_like, dtype=float, shape=(ny, ny)
DD : array_like, dtype=float, shape=(ny, nz)
FF : array_like, dtype=float, shape=(nx, nx)
GG : array_like, dtype=float, shape=(nx, nx)
HH : array_like, dtype=float, shape=(nx, nx)
JJ : array_like, dtype=float, shape=(nx, ny)
KK : array_like, dtype=float, shape=(nx, ny)
LL : array_like, dtype=float, shape=(nx, nz)
MM : array_like, dtype=float, shape=(nx, nz)
NN : array_like, dtype=float, shape=(nz, nz)


Returns :  P : array_like, dtype=float, shape=(nx, nx)
Q : array_like, dtype=float, shape=(nx, nz)
R : array_like, dtype=float, shape=(ny, nx)
S : array_like, dtype=float, shape=(ny, nz)

References
[R1]  Uhlig, H. (1999): “A toolkit for analyzing nonlinear dynamic stochastic models easily,” in Computational Methods for the Study of Dynamic Economies, ed. by R. Marimon, pp. 3061. Oxford University Press. 