purely backward locking model

This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location where you will have to reset your password.
Forum rules
This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location (https://forum.dynare.org) where you will have to reset your password.

purely backward locking model

Postby dt23 » Wed Sep 01, 2010 2:52 pm

Hi
i am new to dynare and encountered problems trying to simulate a NKM with backward looking expectations. As in DeGrauwe 2010 expectations are formed either naivly backwardlooking or according to the steady state values, with individuals deciding an the basis of the 2 expectation rules' past performance according to squared deviations.
While this model could be implemented in excel i wonder why it doesnt work in dynare. Something seems to go wrong with the squared deviations individuals use to evaluate the expectation rules. The Utility indexes of the 2 forecasting rules (Uye, Uyf, Upie, Upif) are not simulated as expected (they are always very close to zero) and correspondingly the forecasts are not plausible. Omitting the ^2 yields plausible results.
Can someone find the problem? Does this model violate some of dynare's assumptions?
It is:

var y pi r Ey Eyf Eye alpha_ye Uyf Uye Epif Epie Epi Upie Upif alpha_pie;
varexo error_y error_pi error_r;
parameters a_one a_two b_one b_two c_one c_two c_three target growth gamma sigma_one sigma_two sigma_three rho;

a_one = 0.5;
a_two = -0.2;
b_one = 0.5;
b_two = 0.05;
c_one = 1.5;
c_two = 0.5;
c_three = 0.5;
growth = 0;
target = 0;
gamma = 1;
sigma_one = 0.5;
sigma_two = 0.5;
sigma_three = 0.5;
rho = 0.5;

model;
y = a_one*Ey+(1-a_one)*y(-1)+a_two*(r-Epi)+error_y;
pi = b_one*Epi+(1-b_one)*pi(-1)+b_two*y+error_pi;
r = c_one*(pi-target)+c_two*y+c_three*r(-1)+error_r;
Eyf = growth;
Eye = y;
Ey = Eye*alpha_ye+Eyf*(1-alpha_ye);
Uyf = -1*(1-rho)*rho*(y(-1)-Eyf(-2))^2+Uyf(-1)*rho;
Uye = -1*(1-rho)*rho*(y(-1)-Eye(-2))^2+Uye(-1)*rho;

alpha_ye = exp(gamma*Uye)/(exp(gamma*Uyf)+exp(gamma*Uye));
Epif = target;
Epie = pi;
Epi = Epie*alpha_pie+(1-alpha_pie)*Epif;
Upif = -1*(1-rho)*rho*(pi(-1)-Epif(-2))^2+Upif(-1)*rho;
Upie = -1*(1-rho)*rho*(pi(-1)-Epie(-2))^2+Upie(-1)*rho;

alpha_pie = exp(gamma*Upie)/(exp(gamma*Upif)+exp(gamma*Upie));
end;

initval;
y = 0;
pi = 0;
r = 0.01;
Eyf = 0;
Eye = 0;
Ey = 0;
Uyf = 1;
Uye = 0;
alpha_ye = 0;
Epif = 0;
Epie = 0;
Epi = 0;
Upif = 1;
Upie = 0;
alpha_pie = 0;
end;

check;

shocks;
var error_y = sigma_one;
var error_pi = sigma_two;
var error_r = sigma_three;
end;

stoch_simul(periods=1000, nograph, solve_algo = 2, order = 1);
dt23
 
Posts: 11
Joined: Wed Sep 01, 2010 2:35 pm

Re: purely backward locking model

Postby jpfeifer » Wed Sep 01, 2010 4:20 pm

It might do nothing to solve your problem, but the steady state is wrong. You did not put "steady" before check, so your initial values are taken as the true steady state values, which is apparently not the case. Set the check command and you will see the true steady state values for the entered model.
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: purely backward locking model

Postby dt23 » Fri Sep 03, 2010 1:23 pm

Indeed, i forgot that line in the skript i copied here, but that doesnt change the problem unfortunately. Thanks anyway.
dt23
 
Posts: 11
Joined: Wed Sep 01, 2010 2:35 pm

Re: purely backward locking model

Postby SébastienVillemot » Mon Sep 13, 2010 9:37 am

Your model obviously has problems: you have several endogenous variables with zero variance.

For example, “Eyf” is set equal to “growth” (a parameter) and is therefore constant. Similarly, “Uye” is also constant (since “y” is equal to “Eye”). And so on…

Dynare correctly reports these variable as having zero variance.
Sébastien Villemot
Economist at OFCE – Sciences Po
SébastienVillemot
 
Posts: 706
Joined: Fri Dec 07, 2007 2:29 pm
Location: Paris, France

Re: purely backward locking model

Postby dt23 » Fri Sep 17, 2010 12:59 pm

Sebastien, thank you for your hints.

I dropped the unneccessary variables, but the problem remains the same.

The alphas and U*s are constant (at 0.5 and 0). The U*s are not correctly determined (they determine the alphas).

What strikes me is that changing ^2 to ^1 (see bold part of the code) changes the picture. Can it be related to the linearization that dynare conducts? Is there a need to linearize these equations, even though they are purely predetermined? Yet changing “model” to “model (linear)” doesn’t help.

Might this be the source of the error and how could I cope with it?

What the model should do:
1st block: 3 equations standart NKM with smoothing Taylor rule
2nd block: determination of irrational expactations of the outputgap (Ey) as an average of extrapolative (alpha_ye) and steady state expectations, weighted according to their historical performance in terms of squared deviation (Uye and Uyf).
3rd block: determination of irrational expactations of inflation (Epi) as an average of extrapolative (alpha_pie) and steady state expectations, weighted according to their performance in terms of squared deviation (Upie and Upif).

Thanks for any support!!!!
Dominik


var y pi r Ey alpha_ye Uyf Uye Epi Upie Upif alpha_pie;
varexo error_y error_pi error_r;
parameters a_one a_two b_one b_two c_one c_two c_three target growth gamma sigma_one sigma_two sigma_three rho;

a_one = 0.5;
a_two = -0.2;
b_one = 0.5;
b_two = 0.05;
c_one = 1.5;
c_two = 0.5;
c_three = 0.5;
growth = 0;
target = 0;
gamma = 1;
sigma_one = 0.5;
sigma_two = 0.5;
sigma_three = 0.5;
rho = 0.5;

model;
y = a_one*Ey+(1-a_one)*y(-1)+a_two*(r-Epi)+error_y;
pi = b_one*Epi+(1-b_one)*pi(-1)+b_two*y+error_pi;
r = c_one*(pi-target)+c_two*y+c_three*r(-1)+error_r;

Ey = y(-1)*alpha_ye+growth*(1-alpha_ye);
Uyf = -1*(1-rho)*rho*(y(-1)-growth)^2+Uyf(-1)*rho;
Uye = -1*(1-rho)*rho*(y(-1)-y(-2))^2+Uye(-1)*rho;

alpha_ye = exp(gamma*Uye)/(exp(gamma*Uyf)+exp(gamma*Uye));

Epi = pi(-1)*alpha_pie+(1-alpha_pie)*target;
Upif = -1*(1-rho)*rho*(pi(-1)-target)^2+Upif(-1)*rho;
Upie = -1*(1-rho)*rho*(pi(-1)-pi(-2))^2+Upie(-1)*rho;

alpha_pie = exp(gamma*Upie)/(exp(gamma*Upif)+exp(gamma*Upie));
end;

initval;
y = 0;
pi = 0;
r = 0.01;
Ey = 0;
Uyf = 1;
Uye = 0;
alpha_ye = 0;
Epi = 0;
Upif = 1;
Upie = 0;
alpha_pie = 0;
end;

steady;
check;

shocks;
var error_y = sigma_one;
var error_pi = sigma_two;
var error_r = sigma_three;
end;

stoch_simul(periods=1000, nograph, solve_algo = 2, order = 1);
dt23
 
Posts: 11
Joined: Wed Sep 01, 2010 2:35 pm


Return to Dynare help

Who is online

Users browsing this forum: No registered users and 6 guests