I was trying to replicate the result of Bernake and Gertler’s paper “monetary policy and asset price volatility” and confronted a weird error. When i ran the model, an error was reported:

Starting Dynare (version 4.2.4).
Starting preprocessing of the model file …
Substitution of Expectation operator: added 2 auxiliary variables and equations.
ERROR: There are 20 equations but 19 endogenous variables!

My model exactly matches (A.1) to (A.18) of BG’s paper (the extra two variables and two equations come from the substitution of EXPECTATION operator). I checked BG’s paper carefully and found they have 18 equations but only 17 variables. Has anybody worked out BG’s model?