Taylor rule simulation

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.

Taylor rule simulation

Postby ramram » Tue Mar 19, 2013 1:46 pm

Hi,
I'm a Dynare starter, I would like to do a stochastic simulation (Taylor rule). I created the file with .mod extension and I set the path as mentionned in the guide. I defined the exogeneous and endogeneous variables, the parameters, the value of the parameters, the model. I wonder how to use the option initval (which kind of value have I put) and what I have to do in order to lunch a first temptation. Thanks
ramram
 
Posts: 10
Joined: Tue Mar 19, 2013 1:08 pm

Re: Taylor rule simulation

Postby jpfeifer » Tue Mar 19, 2013 9:44 pm

initval takes starting values for the steady state search. Analytical steady state values are best. If not available, use economic theory as a guide. Output is larger than consumption is larger than investment. All three are positive. Moreover, labor usually is around 1/3 and the real interest rate about 4%. Avoid the most common problem: using no value and thus 0 as the starting value for variables that can never turn negative (like consumption).
------------
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: Taylor rule simulation

Postby ramram » Wed Mar 20, 2013 7:39 am

Thank you for the response. Well, I tried to do that. My new script (where the program was written) was saved as .mod file. When I try to lunch run file.mod, it indicate this error

??? Undefined variable "file" or class "file.mod".
Error in ==> run at 74
evalin('caller',[script ';']);

However, when I try to lunch dynare file.mod it show this message
Configuring Dynare ...
[mex] Generalized QZ.
[mex] Sylvester equation solution.
[mex] Kronecker products.
[mex] Sparse kronecker products.
[mex] Local state space iteration (second order).
[mex] Bytecode evaluation.
[mex] k-order perturbation solver.
[mex] k-order solution simulation.
[mex] Quasi Monte-Carlo sequence (Sobol).
[mex] Markov Switching SBVAR.

Starting Dynare (version 4.3.2).
Starting preprocessing of the model file ...
ERROR: file.mod:13.10: character unrecognized by lexer

??? Error using ==> dynare at 114
DYNARE: preprocessing failed

Any help????
ramram
 
Posts: 10
Joined: Tue Mar 19, 2013 1:08 pm

Re: Taylor rule simulation

Postby jpfeifer » Wed Mar 20, 2013 11:14 am

The second command is the correct one. The message says
ERROR: file.mod:13.10: character unrecognized by lexer

It means that there is a problem in line 13 at character 10. You may want to post the mod-file.
------------
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: Taylor rule simulation

Postby ramram » Thu Mar 21, 2013 3:34 pm

Thank you very much jpfeifer
well, to expose the whole problem, my aim is to simulate monetary rule (similarly to Taylor one). In particular, I would like to find the two parameters: alpha (weight of the output gap) and beta (weight of the inflation). I have a model with two equations (demand and supply equation) +the monetary rules and I would like to reproduce shocks from this model and get the optimal parameters (alpha and beta) that minimize a loss function. I have written the program below in my script and I have run the file.mod but it didn't work.
i would be gratreful If you have any idea or suggestion.
regards
The program
var y, pi, tc, br, oil;
varexo ey, epi, etc, eoil;
parameters a, b1, b2, c, d1, d2, e1, e2, f, g, h, alpha, beta;
a=0.64;
b1=0.67;
b2=-0.74;
c=0.23;
d1=0.55;
d2=0.3;
e1=-0.29;
e2=-0.32;
f=0.03;
g=0.07;
h=0.18;
alpha=0.5;
beta=0.5;
model;
y=a*y(-1)+b1*pi(-1)+b2*pi(-2)+c*br(-1)+ey;
pi=d1*pi(-1)+d2*pi(-2)+e1*y(-1)+e2*y(-2)+f*oil(-1)+g*br(-1)+epi;
tc=h*tc(-1);
br=alpha*y+beta*pi;
end;
initval;
y=1;
pi=1;
tc=1;
br=1;
oil=1;
end;
steady;
The loss function
E(L)=sigma*E(pi)^2+teta E(y)^2
ramram
 
Posts: 10
Joined: Tue Mar 19, 2013 1:08 pm

Re: Taylor rule simulation

Postby ramram » Sat Mar 23, 2013 6:22 pm

I finally succeded on turning the model and get the steady state values. But, when I tried to lunch the shocks simulations, this message appear
??? Error using ==> stochastic_solvers at 160
2nd and 3rd order approximation not implemented for purely backward models

Error in ==> resol at 118
[dr,info] = stochastic_solvers(dr,check_flag,M,options,oo);

Error in ==> stoch_simul at 76
[oo_.dr,info,M_,options_,oo_] = resol(0,M_,options_,oo_);

Error in ==> file at 221
info = stoch_simul(var_list_);

Error in ==> dynare at 120
evalin('base',fname) ;

Any help?
ramram
 
Posts: 10
Joined: Tue Mar 19, 2013 1:08 pm

Re: Taylor rule simulation

Postby jpfeifer » Mon Mar 25, 2013 7:45 am

Set order=1. But why does your model not feature any forward-looking variables, i.e. something with expectation/timing (+1)?
------------
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: Taylor rule simulation

Postby ramram » Mon Mar 25, 2013 9:23 am

Thank you for the response
How do U mean by "set order=1? does it mean fixing lag=1?
for the inexistence of forward loooking variables, my model look like an ARDL model, so, I haven't this kind of variables. I guess that I can do simulation even if there is an absence of forward looking variables.
ramram
 
Posts: 10
Joined: Tue Mar 19, 2013 1:08 pm

Re: Taylor rule simulation

Postby jpfeifer » Mon Mar 25, 2013 10:37 am

It means, use
Code: Select all
stoch_simul(order=1);

See the manual.
------------
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: Taylor rule simulation

Postby ramram » Mon Mar 25, 2013 3:18 pm

Thank you,
In doing that, It mention that Blanchard Kahn conditions are not satisfied: no stable equilibrium. This is the complete message.
PS: It's the first time that I use Dynare, so, excuse my naivety

??? Error using ==> print_info at 40
Blanchard Kahn conditions are not satisfied: no stable equilibrium

Error in ==> stoch_simul at 81
print_info(info, options_.noprint);

Error in ==> file at 186
info = stoch_simul(var_list_);

Error in ==> dynare at 120
evalin('base',fname) ;
ramram
 
Posts: 10
Joined: Tue Mar 19, 2013 1:08 pm

Re: Taylor rule simulation

Postby jpfeifer » Mon Mar 25, 2013 4:13 pm

The Blanchard-Kahn conditions are an important condition for the existence and uniqueness of linear rational expectations models. Your model simply has no finite solution. See that 1980 Blanchard-Kahn Econometrica article.
------------
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: Taylor rule simulation

Postby ramram » Tue Mar 26, 2013 4:39 pm

Thank you,
I was encouraged to introduce forwardlooking variables and it works. But, I have two remarks:
1/before introducing shocks, I have used the option resid after the definition of initial values ((initval) and I've got these values. The problem is the following: as well as I modify the initial values, the residuals changes, so, I don't know how to choose the right values of the shocks.
2/after introducing shocks (in an arbitrary way), I notice that the final value of parameters simulated (alpha and beta) dosen't change when I change the weight defined in the loss function (optim_weights option). However, alpha and beta change when I change manually these same parameters (alpha and beta) introduced as part of the "osr_params" option. Is it normal?
Tanks
ramram
 
Posts: 10
Joined: Tue Mar 19, 2013 1:08 pm


Return to Dynare help

Who is online

Users browsing this forum: No registered users and 8 guests