Page 1 of 2

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

PostPosted: Sat Oct 11, 2014 6:51 am
by zhuzixiang
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?

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

PostPosted: Wed Oct 15, 2014 9:20 am
by jpfeifer
You can find a replication file for the model on my homepage at https://sites.google.com/site/pfeiferecon/dynare

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

PostPosted: Tue Dec 16, 2014 11:54 am
by ozgrbhr
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,

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

PostPosted: Tue Dec 16, 2014 6:58 pm
by jpfeifer
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.

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

PostPosted: Wed Dec 17, 2014 9:36 am
by ozgrbhr
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) ;

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

PostPosted: Wed Dec 17, 2014 10:11 am
by jpfeifer
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.

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

PostPosted: Wed Dec 17, 2014 12:06 pm
by ozgrbhr
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.

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

PostPosted: Wed Dec 17, 2014 1:15 pm
by ozgrbhr
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) ;

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

PostPosted: Wed Dec 17, 2014 4:12 pm
by jpfeifer
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.

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

PostPosted: Thu Dec 18, 2014 11:46 am
by ozgrbhr
Thank you so much for your kind care.

Best wishes.

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

PostPosted: Tue Dec 30, 2014 11:27 am
by ozgrbhr
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.

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

PostPosted: Mon Jan 05, 2015 10:36 pm
by jpfeifer
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.

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

PostPosted: Wed Jan 28, 2015 12:52 pm
by ozgrbhr
Thank you very much. I really appreciated your help.

Best wishes.

Bahar.

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

PostPosted: Thu Feb 05, 2015 7:43 am
by ozgrbhr
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.

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

PostPosted: Thu Feb 05, 2015 10:21 am
by jpfeifer
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.