This algorithm extends Ljungqvist and Sargent (2012) algorithm of Stackelberg dynamic game to the case of dynamic stochastic general equilibrium models including exogenous forcing variables. It is based Anderson, Hansen, McGrattan, Sargent (1996) discounted augmented linear quadratic regulator. It adds an intermediate step in solving a Sylvester equation. Forward-looking variables are also optimally anchored on forcing variables. This simple algorithm calls for already programmed routines for Ricatti, Sylvester and Inverse matrix in Matlab and Scilab. A final step using a change of basis vector computes a vector auto regressive representation including Ramsey optimal policy rule function of lagged observable variables, when the exogenous forcing variables are not observable.
Stackelberg dynamic game Ramsey optimal policy Augmented linear quadratic regulator Algorithm