NOTES ON THE GENSYS2 PACKAGE

CHRISTOPHER A. SIMS

This package assumes the user has a model in the form

K(w_{t}, w_{t−1}, ε_{t}) + Πη_{t} = c ,  (1)

where E_{t}η_{t+1} = 0 and E_{t}ε_{t+1} = 0. The disturbances ε_{t} are exogenously given, while η_{t} is determined as a function of ε when the model is solved. There are n equations and n elements in w.

We assume the model has a deterministic steady state w̄ satisfying

K(w̄, w̄, 0) = C .  (2)

We assume that the solution will imply that w_{t} remains always on a stable manifold, defined by H(w_{t}) = 0 and satisfying

{H(w_{t}) = γ and K(w_{t+1}, w_{t}, ε_{t+1}) + η_{t+1} = C} ⇒ H(w_{t+1}) = γ ,  (3)

when η_{t+1} depends on ε_{t+1} and w_{t} appropriately. The “stability” of this manifold means either that w_{t} → w̄ along it, or that in the neighborhood of w̄ w_{t} diverges from w̄ at a rate no faster than some known bound. It is this condition that allows us to solve for η.

The system (1) has the second-order Taylor expansion about w̄

K_{1ij}dw_{jt} = K_{2ij}dw_{j,t−1} + K_{3ij}ε_{jt}+

\frac{1}{2}(K_{11ijk}dw_{jt}dw_{kt} + 2K_{12ijk}dw_{jt}dw_{k,t−1} + 2K_{13ijk}dw_{jt}ε_{kt} + K_{22ijk}dw_{j,t−1}dw_{k,t−1} + 2K_{23ijk}dw_{j,t−1}ε_{kt} + K_{33ijk}ε_{jt}ε_{kt}) , (4)

where we have resorted to tensor notation. That is, we are using the notation that

A_{ijk}B_{mnjq} = C_{ikmnq} ⇔ c_{ikmnq} = ∑_{j} a_{ijk}b_{mnjq} .  (5)

                                          GENSYS2  2

where a, b, c in this expression refer to individual elements of multidimensional arrays, while A, B, C refer to the arrays themselves. As special case, for example, ordinary matrix multiplication is AB = A_{ij}B_{jk} and the usual matrix expression A′BA becomes A_{ji}B_{jk}A_{km}. Note that we are distinguishing the array K_{mij} of first derivatives from the array K_{mnijk} of second derivatives only by the number of indexing subscripts the two arrays have.

\begin{matrix}c \\ ◯ \end{matrix}2000 by Christopher A. Sims. This material may be reproduced for educational and research purposes so long as the copies are not sold, even to recover costs, the document is not altered, and this copyright notice is included in the copies.

The solution will take the form

y_{t} = F (y_{t−1}, ε_{t})  (6)
x_{t} = M(y_{t}) ,  (7)

where [y′_{t} x′_{t}]′ = Z′w_{t}, with Z a square, non-singular matrix. Equation (7) is just (3) solved for some particular linear combination of w’s (i.e. x). If the original system has a standard “state-control” form, y can be taken as the state variable and x as the control variable. However the gensys2 program does not require that the system be put in this form to start with. If it will aid interpretation to specify the state vector in advance, the program will use the prespecified y vector; but it can also generate a y on its own.

The second-order expansion of the solution is

\begin{matrix}dy_{it} = & F_{1ij}dy_{j,t−1} + F_{2ij}ε_{jt} + F_{3i}σ^{2} \\ + \frac{1}{2}(F_{11ijk}dy_{j,t−1}dy_{k,t−1} + 2F_{12ijk}dy_{j,t−1}ε_{kt} + F_{22ijk}ε_{jt}ε_{kt}) \end{matrix}  (8)
dx_{it} =M_{11ijk}dy_{jt}dy_{kt} + M_{2i}σ^{2} .  (9)

The program’s calling sequence is

  [FD, FDD, M11, M2, C, q, zs, zu, v, gev, eu]
                                = gensys2(KD, KDD, c, Pi, omega, pick, div).

KD:  A 1×3 cell array with KD{j}= K_{j··} from (4).
KDD:  A 3×3 cell array with KDD{jkm}= K_{jk···} from (4).
c:  The right-hand side of (1).
Pi:  The coefficient on η from (1).
omega:  The normalized covariance matrix of ε, i.e. Ω from Var(ε(t)) = σ^{2}Ω.

pick: Candidate weights to form y. This is a matrix Ψ such that y_{t} = Ψw_{t}. This argument is optional. If it is missing, or implies an incorrect selection of the state, the program will supply its own Ψ.

div: Dividing line between unstable and “stable” roots. This argument is optional. If it is missing, absolute values of 1 or less are assumed stable and anything larger than 1 is assumed unstable.

FD:  A 1×3 cell array with FD{j}= F_{j··} from (8).
FDD:  A 2×2 cell array with FDD{j,k}= F_{jk···} from (8).
C:  The vector [ȳ − F_{1}ȳ ; x̄] .

q,v: The matrices returned as q,v from [a,b,q,z,v]=qz(KD{1},KD{2}),

after sorting to put unstable generalized eigenvalues at the bottom .

zs,zu: [zs;zu]' is the matrix returned as z by the qz call above. If pick was

not present or was overridden, y_{t} = zs w_{t}. Always x_{t} = zu w_{t} .

gev:  The generalized eigenvalues of K1, K2, sorted.

eu: Existence and uniqueness indicator. See the program’s help notes for details.