# Problem with the Dynare, BGG model with asset bubble model

Dear all,

I am a beginner of dynare and I currently working with the Bernanke & Gertler “Monetary Policy & Asset Price Volatility” paper (1999) and after I conduct my code and I try to run it and it shows, Error using dynare (line 174) DYNARE: preprocessing failed. And doubt checks the location of my file and it is correct.

And I have no idea what mistake that I just made, did I type the equation wrongly? Does anyone know how to solve it?

This is my model.

\Bernanke & Gertler “Monetary Policy & Asset Price Volatility” paper (1999)

var y c ce i g s q mc k r rs rq rk z l pi n rn;

varexo e_rn e_g e_z;

parameters C_Y Ce_Y I_Y G_Y N_K K_N Y_N beta alpha delta rho_z rho_g psi sigma kappa a b thetf thetb tau vthet phi xi rn_t R Rk Rq pi_rl pi_rh;

C_Y = 0.61; // C/Y, BGG
Ce_Y = 0.04; // Ce/Y, p.47
I_Y = 0.18; // I/Y, BGG
G_Y = 0.2; // G/Y, p.47
K_N = 2; // K/N BGG
Y_N = 0.28; // BGG
N_K = 0.5; // N/K p. 47
beta = 0.99; // Time Preference, p.47
alpha = 0.33; // capital share of production, p.47
delta = 0.025; // p.47
rho_z = 1; // BGG, technology obey 4.27
rho_g = 0.95; // BGG
psi = 0.05; // p.47
sigma = 1; // p.47
kappa = 0.086; // p.47
a = 0.98; // Growth rate of exogenous bubble, p.47
b = a*(1-delta); // p.47
theta_f = 0.5; // Inflation Expectation, p.47
theta_b = 0.5; // Inflation Expectation, p.47
tau = 0.95; // The probability of the firm survives in next period, p. 47
vtheta = (1-delta)/((alpha*Y_N/K_N)+1-delta); // p.46

phi = 0.25; // p.47
xi = 1.33; // parameter of utility function (log utility), p.47

rn_t = 1.02; // Target nominal interest
R = 1/beta; // Steady State Level of r
Rk = R+0.02; // Steady State Level of r^k (ASSUMPTION)
Rq = R+0.01; // Steady State Level of r^q (ASSUMPTION)
pi_rl = 1.01; // Inflation Response: Accommodative, p. 30
pi_rh = 2.0; // Inflation Response: Aggressive, p. 30

model;

// Aggregate Demand

y = C_Yc + Ce_Yce + I_Yi + G_Yg; // A1 Aggregate Demand
c = -sigmar + c(+1); // A2 Euler Condition for Household Consumption
ce = s + k(+1); // A3 Assumption: Entrepreneurial Cons is prop. to stock value
q(+1) = phi
(i(+1)-k(+1)); // A4 Investment is prop. to fundamental value of capital

// Returns to Stock and Capital

s(+1) - q(+1) = (s - q) * a * Rq; // A5 The expected evolution of the bubble

rs(+1) = rq(+1) - (1-b)(s-q); // A8 Relation between stock return and fundamental return
rs(+1) = r - psi

// Aggregate Supply

y = z + alphak + (1-alpha)l; // A10 Cobb Douglas Production Function
y - l + mc - c= (xi-1)l; // A11 Household Labor-Leisure Decision
pi = kappa
mc + theta_f
pi(+1) + theta_b
pi(-1); // A12 Evolution of inflation (sticky prices) The Gali n Gertler NK phillip curve

// Evolution of state variables and shock process

k(+1) = deltai + (1-delta)k; // A13 Capital
n = Rq * ( (K_N) * (rs - rs) + (1-tau
Rk)/(tau)y + n(-1)) ); // A14 Internal Equity
g = rho_g
g(-1) + e_g; // A15 Government Spending AR(1) process
z = rho_z
z(-1) + e_z; // A16 Total Factor Productivity AR(1) process (the technology obey BGG 4.27)

// Monetary Policy Rule

r = rn - pi_rl * pi(+1); // A17 Policy Rule Accommodative
r = rn - pi(+1); // A18 Fisher Equation

end;

check;

shocks;
var e_g; stderr 0.1;
var e_z; stderr 0.1;
var e_rn; stderr 1.0;

end;

stoch_simul(irf=24);

I would really appreciate it for your help.

Many Thanks
Kax

Dear Kax,

I think you can now upload files. Here is the file you sent me by private message bg.mod (3.6 KB). I found a lot of typos. Here is a version where I fixed the obvious typos, which passes the preprocessing step bgfixed.mod (3.5 KB). I didn’t try to run the code (i.e. actually perform the simulation with Matlab). The diff between the two files:

``````1c1
< \\Bernanke & Gertler "Monetary Policy & Asset Price Volatility" paper (1999)
---
> //Bernanke & Gertler "Monetary Policy & Asset Price Volatility" paper (1999)
5c5,7
< varexo e_rn e_g e_z;
---
> varexo e_g e_z;
>
> parameters C_Y Ce_Y I_Y G_Y N_K K_N Y_N beta alpha delta rho_z rho_g psi sigma kappa a b theta_f theta_b tau vtheta phi xi rn_t R Rk Rq pi_rl pi_rh;
7d8
< parameters C_Y Ce_Y I_Y G_Y N_K K_N Y_N beta alpha delta rho_z rho_g psi sigma kappa a b thetf thetb tau vthet phi xi rn_t R Rk Rq pi_rl pi_rh;
69c70
< n = Rq * ( (K_N) * (rs - rs) + (1-tau*Rk)/(tau)*y + n(-1)) );         // A14 Internal Equity
---
> n = Rq * ( (K_N) * (rs - rs) + (1-tau*Rk)/(tau)*y + n(-1) );  // A14 Internal Equity
88d88
< var e_rn; stderr 1.0;
``````

Best,
Stéphane.

bg.mod (3.8 KB)
Dear Stéphane,

Thank you for your help, but I do not know why you removed the varexo e_rn in the model? Because in my dissertation I aim to impose a monetary shock into the model and analyzing the dynamic effect on how interest rate shock and asset price affect the economics. And should the central bank take account of asset price in their monetary policy rule.

After I follow your help, and I run the dynare, it came up another error,

1. Error using print_info (line 45)
Blanchard Kahn conditions are not satisfied: indeterminacy
2. Error in stoch_simul (line 95)
print_info(info, options_.noprint, options_);
3. Error in bg (line 308)
info = stoch_simul(var_list_);
4. Error in dynare (line 223)
evalin(‘base’,fname) ;

For the first one, I had found some idea from the previous post in this forum, it mentions the BK condition is something related to the eigenvalue and the forward-looking variables. Sorry for the silly question, I do not quite understand what is the eigenvalue in the dynare means. And In my model, I have 8 forward-looking variables: c(+1), k(+1), q(+1), i(+1), s(+1), rs(+1), rq(+1), pi(+1).

I removed `e_rn` because this shock was not used in the model and Dynare was complaining. Obviously you can add back the shock declaration if you effectively use it in an equation. Otherwise, if you want to run Dynare with declared shocks not appearing in equations, you have to add the `nostrict` option command line option (after the name of your model file, see the reference manual).