Page 1 of 1

Optimal Simple And Implementable Monetary and Fiscal Rules

PostPosted: Fri Mar 14, 2014 12:52 am
by German
Hi,

Im trying to solve the model presented by Martin Uribe and Stephanie Schmitt-Grohe in their paper called "Optimal Simple And Implementable Monetary and Fiscal Rules". I wrote a Dynare code taking into account the equiations, steady state values and parameters given by the authors.

I get these results:

STEADY-STATE RESULTS:

g 0.0552
z 1
c 0.275806
h 0.223127
iv 0.0876772
la 32.6373
mc 0.799726
output 0.418683
pai 0.998607
ptil 0.994516
q 1
u 0.033997
w 1.28657
x1 1.62211
x2 2.02764
s 1.00009
k 3.63806
r 1.00849
m 0.277477
vt -8.02806

EIGENVALUES:
Modulus Real Imaginary

0.5749 0.5726 0.05184
0.5749 0.5726 -0.05184
0.7942 0.7942 0
0.8556 0.8556 0
0.87 0.87 0
0.9726 0.9726 0
1.053 1.053 0
1.268 1.268 0
1.309 1.214 0.4897
1.309 1.214 -0.4897
1.348 1.348 0
Inf Inf 0
Inf Inf 0
Inf Inf 0


There are 8 eigenvalue(s) larger than 1 in modulus
for 9 forward-looking variable(s)

The rank conditions ISN'T verified!

Error using print_info (line 43)
Blanchard Kahn conditions are not satisfied:
indeterminacy

Error in stoch_simul (line 81)
print_info(info, options_.noprint);

Error in m3 (line 245)
info = stoch_simul(var_list_);

Error in dynare (line 120)
evalin('base',fname) ;




Actually, the steady state result i obtain are not far away from those given in the paper. Nevetheles, i am not solving it correctly ....can someone help.

Thanks,
Germán

Re: Optimal Simple And Implementable Monetary and Fiscal Rul

PostPosted: Fri Mar 14, 2014 8:41 am
by Daniel Bendel
Obviously you have a problem with the blanchard kahn conditions. Have you checked the timing of your varibels? Espically for the predeterminded ones!

Re: Optimal Simple And Implementable Monetary and Fiscal Rul

PostPosted: Sat Mar 15, 2014 10:28 pm
by German
Well, i understand that the only two predetermined variables in the model are k(capital) and s(cost of the inefficient price dispersion)
I set those two variables as predetermined ones, so i don't undestand why i keep getting this misktake.
I am wondering that it is becaue of the taylor rule i applied.......

Re: Optimal Simple And Implementable Monetary and Fiscal Rul

PostPosted: Mon Mar 17, 2014 10:12 pm
by georgiana_alina
Hello everybody!
I am trying to run the script for the EHL model, introduced by Erceg, Henderson and Levin(2000) in the article "Optimal Monetary Policy with Staggered Wage and Price Contracts" and posted in Journal of Monetary Economics.
I have tried to run the code in Dynare 4.4.0-using Mathlab (unfortunately I don't know to attach the entire code, for a clear understanding) and the error that occurred is that described below.
Can you please help me with a suggestion regarding the cause that could generate such an error? Thank you very much fro your help.

Description of the error occurred:

WARNING: ehl2000.mod:7.1-12: periods: this command is now deprecated and may be removed in a future version of Dynare. Please use the ''periods'' option of the ''simul'' command instead.
ERROR: ehl2000.mod: line 74, cols 13-21: dr_algo=1 option is no longer supported
Error using dynare (line 156)
DYNARE: preprocessing failed

Re: Optimal Simple And Implementable Monetary and Fiscal Rul

PostPosted: Tue Mar 18, 2014 9:07 am
by jpfeifer
It seems you have to rely on an older Dynare version. See http://www.dynare.org/download/oldies

Re: Optimal Simple And Implementable Monetary and Fiscal Rul

PostPosted: Tue Jun 10, 2014 10:25 am
by Daniel Bendel
Regarding the first post. I found the mistake.
You did not implement equation (17) of the paper correctly.

Instead of
Code: Select all
log(r(+1)/1.0085) = ALFA_R * log(r/1.0085) + ALFA_PAI * log(pai/.9986) + ALFA_Y * log(output/OUTPUTBAR);


you have to use:
Code: Select all
log(r/1.0085) = ALFA_R * log(r(-1)/1.0085) + ALFA_PAI * log(pai/.9986) + ALFA_Y * log(output/OUTPUTBAR);


Then the model runs without any problems.

Monetary and Fiscal policy interactions

PostPosted: Fri May 22, 2015 9:23 am
by georgiana_alina
HI everyone,

I have also tried to run a monetary and fiscal policy model using Dynare 4.4.0 and the error message described below has occurred.
Do you have any idea about the reason of this error, as I have already included the estimated_params function in the attached code?

Any suggestion is helpful, I have also attached the code and data used.

Error:
ESTIMATION_CHECKS: There was an error in computing the likelihood for initial parameter values.
ESTIMATION_CHECKS: You should try using the calibrated version of the model as starting values. To do
ESTIMATION_CHECKS: this, add an empty estimated_params_init-block with use_calibration option immediately before the estimation
ESTIMATION_CHECKS: command (and after the estimated_params-block so that it does not get overwritten):


Error using print_info (line 80)
The steady state contains NaN or Inf
Error in print_info (line 80)
error('The steady state contains NaN or Inf')
Error in initial_estimation_checks (line 69)
print_info(info, DynareOptions.noprint, DynareOptions)
Error in dynare_estimation_1 (line 180)
oo_ = initial_estimation_checks(objective_function,xparam1,dataset_,M_,estim_params_,options_,bayestopt_,oo_);
Error in dynare_estimation (line 84)
dynare_estimation_1(var_list,dname);
Error in eu1 (line 272)
dynare_estimation(var_list_);
Error in dynare (line 162)
evalin('base',fname) ;

Re: Optimal Simple And Implementable Monetary and Fiscal Rul

PostPosted: Sat May 23, 2015 2:13 pm
by jpfeifer
See Remark 2 (Using stoch_simul before Estimation) and
Remark 4 (Parameter dependence and the use of model-local variables)
in Pfeifer(2013): "A Guide to Specifying Observation Equations for the Estimation of DSGE Models" https://sites.google.com/site/pfeiferecon/Pfeifer_2013_Observation_Equations.pdf.

The current problem comes from that you define
Code: Select all
sigma_alpha=(sigma/((1-alpha)+alpha*omega));
omega=(sigma*gamma+(1-alpha)*(sigma*eta-1));

But sigma has not been set and omega is used in the definition of sigma_alpha, but it is only defined thereafter. It should be
Code: Select all
// the description of the estimated equations
/*
IS curve
y=y(+1)-g(+1)+g+alpha*(omega-1)*(rho_yf-1)*yf-(1/sigma_alpha)*(r-pi(+1));
    where
        sigma_alpha=(sigma/((1-alpha)+alpha*omega));
        omega=(sigma*gamma+(1-alpha)*(sigma*eta-1));
    and yf and a are AR(1)
        yf=rho_yf*yf(-1)+e_yf;
        a=rho_a*a(-1)+e_a;

Phillips curve
pi=lb*pi(-1)+lf*pi(+1)+k*mc+e_pi;
     where
         lb=csi/(theta+csi*(1-theta*(1-beta)));
         lf=beta*theta/(theta+csi*(1-theta*(1-beta)));
         k=(1-beta*theta)*(1-theta)*(1-csi)/(theta+csi*(1-theta*(1-beta)));
         mc=((sigma_alpha+fi)*(y-yn)-sigma_alpha*g+tau);
         yn=((1+fi)/(sigma_alpha+fi)*a-(sigma-sigma_alpha)/(sigma_alpha+fi)*yf); 

//mc=(((sigma/((1-alpha)+alpha*omega))+fi)*(y-((1+fi)/((sigma/((1-alpha)+alpha*omega))+fi)*a-(sigma-(sigma/((1-alpha)+alpha*omega)))/((sigma/((1-alpha)+alpha*omega))+fi)*yf))-(sigma/((1-alpha)+alpha*omega))*g+tau);

The fiscal constraint
b(+1)=r+(1/beta)*(b-pi+(1-beta)*(tau-y)+C/B*(g-tau));

The monetary policy rule
 r= rho_r*(r(-1)-rn(-1))+(1-rho_r)*(r_pi*pi+r_y*(y-yn))+rn+e_r;
      where
            rn=sigma_alpha*(yn(+1)-yn)+sigma_alpha*alpha*(omega-1)*(rho_yf-1)*yf;
        or expressed in terms of only "a" and "yf"
            rn=(sigma_alpha*(1+fi)*(rho_a-1)/(sigma_alpha+fi)*a+fi*alpha*(omega-1)/(sigma_alpha+fi)*(rho_yf-1)*yf);


The fiscal policy rules
g=rho_g*g(-1)+(1-rho_g)*(g_y*(y(-1)-yn(-1))+g_b*b)+e_g;
tau=rho_tau*tau(-1)+(1-rho_tau)*(tau_y*(y(-1)-yn(-1))+tau_b*b)+e_tau;
*/
///////////////

var y pi b r g tau yf a;
varexo e_yf e_a e_pi e_r e_g e_tau;
parameters beta eta gamma alpha C B csi theta sigma fi rho_yf rho_a rho_g rho_tau g_y g_b tau_y tau_b rho_r r_pi r_y;


beta=0.99;
eta=1;
gamma=1;
alpha=0.4;
C=0.7;
B=0.3;


fi=2;
sigma=3;
r_pi=1.5;
rho_r=0.5;
rho_g=0.5;
rho_a=0.8;
rho_yf=0.8;
theta=0.5;
r_y=0.4;
g_y=0;
rho_tau=0.5;
tau_y=0;
g_b=-0.03;
tau_b=0.03;
csi=0.7;

model(linear);
#omega=(sigma*gamma+(1-alpha)*(sigma*eta-1));
#sigma_alpha=(sigma/((1-alpha)+alpha*omega));

y=y(+1)-g(+1)+g+alpha*(omega-1)*(rho_yf-1)*yf-(1/sigma_alpha)*(r-pi(+1));

yf=rho_yf*yf(-1)+e_yf;

a=rho_a*a(-1)+e_a;

pi=csi/(theta+csi*(1-theta*(1-beta)))*pi(-1)+beta*theta/(theta+csi*(1-theta*(1-beta)))*pi(+1)+(1-beta*theta)*(1-theta)*(1-csi)/(theta+csi*(1-theta*(1-beta)))*((sigma_alpha+fi)*(y-((1+fi)/(sigma_alpha+fi)*a-(sigma-sigma_alpha)/(sigma_alpha+fi)*yf))-sigma_alpha*g+tau)+e_pi;

b(+1)=r+(1/beta)*(b-pi+(1-beta)*(tau-y)+C/B*(g-tau));

r= rho_r*(r(-1)-(sigma_alpha*(1+fi)*(rho_a-1)/(sigma_alpha+fi)*a(-1)+fi*alpha*(omega-1)/(sigma_alpha+fi)*(rho_yf-1)*yf(-1)))+(1-rho_r)*(r_pi*pi+r_y*(y-((1+fi)/(sigma_alpha+fi)*a-(sigma-sigma_alpha)/(sigma_alpha+fi)*yf)))+(sigma_alpha*(1+fi)*(rho_a-1)/(sigma_alpha+fi)*a+fi*alpha*(omega-1)/(sigma_alpha+fi)*(rho_yf-1)*yf)+e_r;


/*r= rho_r*(r(-1)-(sigma_alpha*(((1+fi)/(sigma_alpha+fi)*a-(sigma-sigma_alpha)/(sigma_alpha+fi)*yf)-((1+fi)/(sigma_alpha+fi)*a(-1)-(sigma-sigma_alpha)/(sigma_alpha+fi)*yf(-1)))+sigma_alpha*alpha*(omega-1)*(rho_yf-1)*yf(-1)))+(1-rho_r)*(r_pi*pi+r_y*(y-((1+fi)/(sigma_alpha+fi)*a-(sigma-sigma_alpha)/(sigma_alpha+fi)*yf)))+(sigma_alpha*(((1+fi)/(sigma_alpha+fi)*a(+1)-(sigma-sigma_alpha)/(sigma_alpha+fi)*yf(+1))-((1+fi)/(sigma_alpha+fi)*a-(sigma-sigma_alpha)/(sigma_alpha+fi)*yf))+sigma_alpha*alpha*(omega-1)*(rho_yf-1)*yf)+e_r;     */

g=rho_g*g(-1)+(1-rho_g)*(g_y*(y(-1)-((1+fi)/(sigma_alpha+fi)*a(-1)-(sigma-sigma_alpha)/(sigma_alpha+fi)*yf(-1)))+g_b*b)+e_g;

tau=rho_tau*tau(-1)+(1-rho_tau)*(tau_y*(y(-1)-((1+fi)/(sigma_alpha+fi)*a(-1)-(sigma-sigma_alpha)/(sigma_alpha+fi)*yf(-1)))+tau_b*b)+e_tau;

end;

steady;

estimated_params;
theta, beta_pdf,0.5,0.1;
fi, normal_pdf,2.0,0.5;
sigma, normal_pdf,3.0,0.75;
rho_r, beta_pdf, 0.5,0.2;
r_pi, gamma_pdf,1.5,0.5;
r_y, gamma_pdf,0.4,0.2;
rho_g, beta_pdf,0.5,0.15;
g_y, normal_pdf, 0,0.05;
rho_tau, beta_pdf,0.5,0.15;
tau_y, normal_pdf,0,0.05;
g_b, normal_pdf,-0.03,0.02;
tau_b, normal_pdf, 0.03,0.01;
csi, beta_pdf,0.7,0.1;
rho_a, beta_pdf,0.8,0.1;
rho_yf,beta_pdf,0.8,0.1;
stderr e_a, inv_gamma_pdf,1.0,4.0;
stderr e_pi, inv_gamma_pdf,0.6,4.0;
stderr e_yf, inv_gamma_pdf,5.0,4.0;
stderr e_r, inv_gamma_pdf,0.4,4.0;
stderr e_g, inv_gamma_pdf,2.0,4.0;
stderr e_tau, inv_gamma_pdf,1.0,4.0;
end;

varobs pi r y g tau;

estimation(datafile=dat,xls_sheet=Sheet1,xls_range=A1:e61,mh_replic=350000,mh_jscale=0.3,mh_nblocks=5,mh_drop=0.5,smoother,filtered_vars,conf_sig=0.95,mode_compute=6) b;

Re: Optimal Simple And Implementable Monetary and Fiscal Rul

PostPosted: Mon May 25, 2015 5:22 pm
by georgiana_alina
Hello everyone!

Many thanks for your quick answer Prof. Dr. Johannes Pfeifer.
I have taken into account the changes proposed by you.
Now the steady state is computed when running the code, but it seems that a new error occurs (it involves also stability problems, as illustrated by Blanchard Kahn condition).
Can you please, indicate me how to solve this new error?


Error description
Error in computing likelihood for initial parameter values

ESTIMATION_CHECKS: There was an error in computing the likelihood for initial parameter values.
ESTIMATION_CHECKS: You should try using the calibrated version of the model as starting values. To do
ESTIMATION_CHECKS: this, add an empty estimated_params_init-block with use_calibration option immediately before the estimation
ESTIMATION_CHECKS: command (and after the estimated_params-block so that it does not get overwritten):


Error using print_info (line 45)
Blanchard Kahn conditions are not satisfied: indeterminacy
Error in print_info (line 45)
error(['Blanchard Kahn conditions are not satisfied:' ...
Error in initial_estimation_checks (line 69)
print_info(info, DynareOptions.noprint, DynareOptions)
Error in dynare_estimation_1 (line 180)
oo_ = initial_estimation_checks(objective_function,xparam1,dataset_,M_,estim_params_,options_,bayestopt_,oo_);
Error in dynare_estimation (line 84)
dynare_estimation_1(var_list,dname);
Error in eu12 (line 263)
dynare_estimation(var_list_);
Error in dynare (line 162)
evalin('base',fname) ;

Many thanks in advance for all your help.

Re: Optimal Simple And Implementable Monetary and Fiscal Rul

PostPosted: Tue May 26, 2015 6:02 pm
by jpfeifer
As always, check the model equations for mistakes, in particular timing problems.