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) = Bu(t). Thus B is the cholesky of the variance covariance matrix such that Sigma = ee’ = B*B’ . My equations look like this:
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
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.
solows11.m (2.36 KB)
tfp_shocksAll1.mod (2.89 KB)
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?
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:
? 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?
Yes, it seems so. Is there a way to provide Eviews with Dynare’s starting values?
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?
OLS and ML are only asymptotically equivalent. Given your few observations, some difference is expected.
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.
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.
I have sent the files to your email address.