Code to replicate Garcıa-Cicco, Pancrazi and Uribe (2010)

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.

Code to replicate Garcıa-Cicco, Pancrazi and Uribe (2010)

Postby zhuzixiang » Sat Oct 11, 2014 6:51 am

Dear all,
I wrote a code trying to replicate the financial friction SOE model in Garcıa-Cicco, Pancrazi and Uribe (2010),
but the rank condition isn't verified.

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

The rank condition ISN'T verified!

I check the timing for the capital stock and it looks all right, could you tell me why?
Attachments
CH_data_1981_2011.m
(1.65 KiB) Downloaded 113 times
three.mod
(4.49 KiB) Downloaded 128 times
zhuzixiang
 
Posts: 12
Joined: Sat Sep 06, 2014 3:36 am

Re: Code to replicate Garcıa-Cicco, Pancrazi and Uribe (2010

Postby jpfeifer » Wed Oct 15, 2014 9:20 am

You can find a replication file for the model on my homepage at https://sites.google.com/site/pfeiferecon/dynare
------------
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: Code to replicate Garcıa-Cicco, Pancrazi and Uribe (2010

Postby ozgrbhr » Tue Dec 16, 2014 11:54 am

Dear Pfeifer,
I try to replicate your code “GarciaCiccoetal2010.mod”. However, it gives this error. May I learn in which version of the dynare your code runs? Would you make any other suggestion?
“Starting Dynare (version 4.4.3).
Starting preprocessing of the model file ...
ERROR: GarciaCiccoetal2010(1).mod: line 324, cols 9-15: syntax error, unexpected NAME

Error using dynare (line 174)
DYNARE: preprocessing failed”

this line 324 corresponds to 3 rd row this
estimation(datafile=data_argentina,
xls_range=G2:J107,
logdata, //data is already logged, loglinear option would otherwise log the data
mode_check,
mode_compute=6,
moments_varendo,
mh_nblocks=1,
mh_replic=2000000
);
Your help would be greatly appreciated.

Best regards,
ozgrbhr
 
Posts: 10
Joined: Tue Dec 16, 2014 7:50 am

Re: Code to replicate Garcıa-Cicco, Pancrazi and Uribe (2010

Postby jpfeifer » Tue Dec 16, 2014 6:58 pm

It runs in the unstable version. The logdata command is new there. Alternatively, you can use 4.4.3 by deleting that statement and taking exp() of the data.
------------
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: Code to replicate Garcıa-Cicco, Pancrazi and Uribe (2010

Postby ozgrbhr » Wed Dec 17, 2014 9:36 am

Thank you very much for your reply. I just downloaded and reinstalled the unstable version of Dynare, and now it works. But it gives this error in the estimation part.



COEFFICIENTS OF AUTOCORRELATION

Order 1 2 3 4 5
g_y 0.0382 0.0341 0.0260 0.0179 0.0109
g_c -0.0175 -0.0124 -0.0107 -0.0104 -0.0106
g_invest -0.0732 -0.0486 -0.0345 -0.0262 -0.0212
tb_y 0.5157 0.2655 0.1365 0.0704 0.0369
g_y g_c g_inv TB/Y
Standard Deviations: 6.2378 8.5158 17.8438 5.0296
Correlation with g_y: 1.0000 0.7646 0.3333 -0.0151
First Order Autocorr.: 0.0382 -0.0175 -0.0732 0.5157
Second Order Autocorr.: 0.0341 -0.0124 -0.0486 0.2655
Third Order Autocorr.: 0.0260 -0.0107 -0.0345 0.1365
Fourth Order Autocorr.: 0.0179 -0.0104 -0.0262 0.0704
Correlation with TB/Y: -0.0151 -0.3011 -0.2096 1.0000


Error using dynare_estimation
Too many output arguments.
Error in GarciaCiccoetal2010 (line 321)
oo_recursive_=dynare_estimation(var_list_);
Error in dynare (line 185)
evalin('base',fname) ;
ozgrbhr
 
Posts: 10
Joined: Tue Dec 16, 2014 7:50 am

Re: Code to replicate Garcıa-Cicco, Pancrazi and Uribe (2010

Postby jpfeifer » Wed Dec 17, 2014 10:11 am

That is bad timing, because you downloaded the unstable version while a change was underway. You can either use tomorrow's unstable version or simply replace the file in your dynare/matlab folder with the attached one. Sorry for the hassle.
Attachments
dynare_estimation.m
(7.38 KiB) Downloaded 108 times
------------
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: Code to replicate Garcıa-Cicco, Pancrazi and Uribe (2010

Postby ozgrbhr » Wed Dec 17, 2014 12:06 pm

As you suggested, I replaced the file in my dynare/matlab folder with the attached one. Now it works. Thank you very much. I really appreciate your help.
ozgrbhr
 
Posts: 10
Joined: Tue Dec 16, 2014 7:50 am

Re: Code to replicate Garcıa-Cicco, Pancrazi and Uribe (2010

Postby ozgrbhr » Wed Dec 17, 2014 1:15 pm

Dear Pfeifer,

In the code financial friction part works very well, but when I change the rbc=1 for RBC model, it gives this error. The reason may stem from the dynareestimation1 code or not?

Thank you very much.

Choose one of the following options:

[1] Consider all the endogenous variables.
[2] Consider all the observed endogenous variables.
[3] Stop Dynare and change the mod file.

options [default is 1] = 1

Error using check_prior_bounds (line 39)
Initial value(s) of SE_EOBS_g_y, SE_EOBS_tb_y are outside parameter bounds. Potentially,
you should set prior_trunc=0. If you used the mode_file-option, check whether your
mode-file is consistent with the priors.
Error in dynare_estimation_init (line 302)
check_prior_bounds(xparam1,bounds,M_,estim_params_,options_,bayestopt_)
Error in dynare_estimation_1 (line 102)
[dataset_, dataset_info, xparam1, hh, M_, options_, oo_, estim_params_, bayestopt_, bounds]
= ...
Error in dynare_estimation (line 91)
dynare_estimation_1(var_list,dname);
Error in GarciaCiccoetal2010 (line 297)
oo_recursive_=dynare_estimation(var_list_);
Error in dynare (line 185)
evalin('base',fname) ;
ozgrbhr
 
Posts: 10
Joined: Tue Dec 16, 2014 7:50 am

Re: Code to replicate Garcıa-Cicco, Pancrazi and Uribe (2010

Postby jpfeifer » Wed Dec 17, 2014 4:12 pm

Sorry. That was my mistake. I should have checked this. The reason is that due to rounding the reported posterior mean in the paper coincides with the lower bound of the prior. I uploaded an updated file that adds an epsilon to the initial values.
------------
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: Code to replicate Garcıa-Cicco, Pancrazi and Uribe (2010

Postby ozgrbhr » Thu Dec 18, 2014 11:46 am

Thank you so much for your kind care.

Best wishes.
ozgrbhr
 
Posts: 10
Joined: Tue Dec 16, 2014 7:50 am

Re: Code to replicate Garcıa-Cicco, Pancrazi and Uribe (2010

Postby ozgrbhr » Tue Dec 30, 2014 11:27 am

Dear Pfeifer,

I run your code and try to obtain the same results for table 4. In your code you stated that results of Table 4 can be found in oo_.PosteriorTheoreticalMoments.dsge.correlation and covariance. But, there are many numbers which are very different from the table in the paper. I could not understand whether the numbers refer correlation with gy or serial correlation. However, there is no problem with variance decompositions, they are the same. Could you help me?

Thank you very much,

Best wishes.

Bahar.
ozgrbhr
 
Posts: 10
Joined: Tue Dec 16, 2014 7:50 am

Re: Code to replicate Garcıa-Cicco, Pancrazi and Uribe (2010

Postby jpfeifer » Mon Jan 05, 2015 10:36 pm

Dear Bahar,
the oo_.PosteriorTheoreticalMoments.dsge.correlation directly stores the serial correlation. These are the numbers that should be identical (the first entry which is the first order serial correlation). In oo_.PosteriorTheoreticalMoments.dsge.covariance you have the covariances and variances. But Garcia-Cicco report correlations. Thus, you still have to use these fields to compute the correlations reported in the table, using the fact that the correlation is the covariance between two variables, divided by the corresponding standard deviations.
------------
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: Code to replicate Garcıa-Cicco, Pancrazi and Uribe (2010

Postby ozgrbhr » Wed Jan 28, 2015 12:52 pm

Thank you very much. I really appreciated your help.

Best wishes.

Bahar.
ozgrbhr
 
Posts: 10
Joined: Tue Dec 16, 2014 7:50 am

Re: Code to replicate Garcıa-Cicco, Pancrazi and Uribe (2010

Postby ozgrbhr » Thu Feb 05, 2015 7:43 am

Dear Pfeifer,

I have one more question related to your code. After running the code, I obtained estimated shocks from oo_.SmoothedShocks. When I calculate the correlation matrix of estimated shocks for 20000 draws, I obtained this correlation matrix. Trend shock and transitory technology shocks are highly correlated (0,86) even if we impose no correlation among shocks.
How can I solve this problem? Is there any way to obtain orthogonal shocks after estimation?
Correlation matrix
e_a e_g e_nu e_mu e_s
e_a 1.000 0.862 -0.155 -0.156 -0.038
e_g 0.862 1.000 -0.210 -0.112 -0.275
e_nu -0.155 -0.210 1.000 0.066 0.086
e_mu -0.156 -0.112 0.066 1.000 -0.103
e_s -0.038 -0.275 0.086 -0.103 1.000

Thank you very much.

Best regards,

Bahar.
ozgrbhr
 
Posts: 10
Joined: Tue Dec 16, 2014 7:50 am

Re: Code to replicate Garcıa-Cicco, Pancrazi and Uribe (2010

Postby jpfeifer » Thu Feb 05, 2015 10:21 am

Are you talking about results with their data? If yes, this indicates model misspecification. The smoothed shocks should approximately follow the assumed distribution. There is no way to strictly impose them to be uncorrelated, but the likelihood function should punish such deviations from the assumption.
------------
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

Next

Return to Dynare help

Who is online

Users browsing this forum: No registered users and 14 guests