Page 1 of 1

Estimating Solow residuals in Dynare 4.3.3

PostPosted: Thu Oct 02, 2014 8:19 am
by kyri82
Hi all,

I have a two-country, two-sector model and I am trying to estimate a TFP process out of Solow residuals. As I want to impose some restrictions on the VAR(1) matrix and on the var-cov matrix I am trying to use Dynare and do the estimation with ML. To do so, I assume that there is a matrix B which relates the actual residuals with some other error terms which are orthogonal to each other and with unit variance: e(t) = B*u(t). Thus B is the cholesky of the variance covariance matrix such that Sigma = e*e' = B*B' . My equations look like this:

Code: Select all
zT1 = A1T_11*zT1(-1) + A1T_12*zT2(-1) + A1T_13*zN1(-1) + A1T_14*zN2(-1) + a*eT1 ;
zT2 = A2T_11*zT1(-1) + A2T_12*zT2(-1) + A2T_13*zN1(-1) + A2T_14*zN2(-1) + b*eT1 + c*eT2 ;
zN1 = A1N_11*zT1(-1) + A1N_12*zT2(-1) + A1N_13*zN1(-1) + A1N_14*zN2(-1) + d*eT1 + e*eT2 + f*eN1 ;
zN2 = A2N_11*zT1(-1) + A2N_12*zT2(-1) + A2N_13*zN1(-1) + A2N_14*zN2(-1) + g*eT1 + h*eT2 + k*eN1 + l*eN2 ;


... with a,b, c,... being the elements of matrix B which I could potentially restrict.

I start without imposing any restrictions on the parameters, such that the solution from an OLS estimation and from ML coincide. I run the estimation also in EViews. My question is why the estimates in Dynare (as outlined above) and in Eviews do not coincide? The differences are not very big, but I would not say insignificant. And the estimation converges pretty fast without much signs of problems, if I read the output well. I use the default alogrythm, I (still) have Dyare 4.3.3.

As observables, I feed the estimated Solow residuals in logs and linearly-detrended (I follow a paper that does the same). In that case, I do not need to use the prefilter=1 option right? It does not make much difference anyway... And should I do
Code: Select all
model (linear)
or not? The results are identical anyhow but I am just wondering...

Thanks in advance for your help. I attach the code together with the data file.

Best,

Kyriacos

Re: Estimating Solow residuals in Dynare 4.3.3

PostPosted: Fri Oct 03, 2014 10:36 am
by jpfeifer
You do not need the model(linear), but if your model is linear, it speeds up computations a bit.

You should not use the prefilter option, because both your data and and your model variables are mean 0 (see also "A Guide to Specifying Observation Equations for the Estimation of DSGE Models")

Did you check what happens if you take Eviews's final values as starting values in Dynare? Is the likelihood higher or lower than with the values found with Dynare?

Re: Estimating Solow residuals in Dynare 4.3.3

PostPosted: Sun Oct 05, 2014 3:53 pm
by kyri82
Thank you jpfeifer,

Indeed I used EViews final values as initial ones in the Dynare-ML estimation. Before I posted on the blog I did that only for the persistence parameters, following your comment I did it also for the elements of the variance-covariance matrix and the results are the same.

The value of the likelihood in Dynare is found at the comment:
Objective function at mode: -427.833734
? If yes, this is higher (in absolute value, right?) than the one in Eviews which is 416.5150. Does that mean that the estimation in Dynare is better?

Thanks again!

Best,

Kyriacos

Re: Estimating Solow residuals in Dynare 4.3.3

PostPosted: Mon Oct 06, 2014 5:14 am
by jpfeifer
Yes, it seems so. Is there a way to provide Eviews with Dynare's starting values?

Re: Estimating Solow residuals in Dynare 4.3.3

PostPosted: Tue Oct 07, 2014 12:18 pm
by kyri82
Well not really.
EViews is doing OLS, so it is not really an algorythm that initial values etc. Note that when I do the OLS estimation in Matlab I (naturally) get the same result as in EViews.

Do you think this is something that needs to be flagged to the Dynare team? Otherwise, is it "save enough" to proceed with the restricted likelihood estimation?

K.

Re: Estimating Solow residuals in Dynare 4.3.3

PostPosted: Tue Oct 07, 2014 12:33 pm
by jpfeifer
OLS and ML are only asymptotically equivalent. Given your few observations, some difference is expected.

Re: Estimating Solow residuals in Dynare 4.3.3

PostPosted: Tue Oct 07, 2014 4:46 pm
by kyri82
Of course...

Re: Estimating Solow residuals in Dynare 4.3.3

PostPosted: Wed Oct 08, 2014 6:50 am
by jpfeifer
Dynare's standard estimation feature is thorougly tested for bugs. Given that your file does not use any extravagant or seldomly used features, I am confident that the results from Dynare are correct. From the fact that the likelihood from Dynare is better than the one from Eviews and that Eviews presents OLS results, I don't think that there is a bug in Dynare here that shows up. If you do not believe me, I could provide you with Matlab code for restricted ML VAR-estimation where you could cross-check your results.

Re: Estimating Solow residuals in Dynare 4.3.3

PostPosted: Thu Oct 09, 2014 11:01 am
by kyri82
Hi jpfeifer,
Of course I trust you :)
However I wouldn't mind cross-checking my results with a Matlab code, if you do not mind sharing it. That would be also more "visible" for me.
Thanks!

K.

Re: Estimating Solow residuals in Dynare 4.3.3

PostPosted: Fri Oct 10, 2014 5:08 am
by jpfeifer
I have sent the files to your email address.