Klein Solver
RationalExpectations.klein — Method.klein(A,B,C,t,k0,shock_exp,jumps)A,B,Csee bellowtis the number of periods to be simulatedk0is the initial condition for the stable part of the system.shock_expis the expected value of the future shocks, usually zero.jumpis a vector that tells the position of the jump variables
Solves a rational expectation models using Klein(2000) method. The model has to be written in the following way:
Where $\mathbf{x_t}$ is the vector we are interested in and $\varepsilon_t$ is a vector of random shocks. For now, the jumps variables must be the last variables in the system.
To guarantee that there is a stable solution, we need to check the Blanchard Khan conditions: the number of eigenvalues bigger than 1 is equal to the number of non predeterminated variables in the problem (e.g. variables that depend on the expectation of its future value), which are also called jump variables.
This method accepts a matrix A that is singular.
Important
When you add an autocorrelated shock to the system, the value on the lhs must be on t+1. Otherwise, the IRF will be wrongly computed.