Estimating Solow residuals in Dynare 4.3.3

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.

Estimating Solow residuals in Dynare 4.3.3

Postby kyri82 » Thu Oct 02, 2014 8:19 am

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
Attachments
solows11.m
(2.36 KiB) Downloaded 221 times
tfp_shocksAll1.mod
(2.89 KiB) Downloaded 198 times
kyri82
 
Posts: 141
Joined: Thu Feb 10, 2011 6:14 pm
Location: Toulouse - France

Re: Estimating Solow residuals in Dynare 4.3.3

Postby jpfeifer » Fri Oct 03, 2014 10:36 am

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?
------------
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: Estimating Solow residuals in Dynare 4.3.3

Postby kyri82 » Sun Oct 05, 2014 3:53 pm

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
kyri82
 
Posts: 141
Joined: Thu Feb 10, 2011 6:14 pm
Location: Toulouse - France

Re: Estimating Solow residuals in Dynare 4.3.3

Postby jpfeifer » Mon Oct 06, 2014 5:14 am

Yes, it seems so. Is there a way to provide Eviews with Dynare's starting 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: Estimating Solow residuals in Dynare 4.3.3

Postby kyri82 » Tue Oct 07, 2014 12:18 pm

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.
kyri82
 
Posts: 141
Joined: Thu Feb 10, 2011 6:14 pm
Location: Toulouse - France

Re: Estimating Solow residuals in Dynare 4.3.3

Postby jpfeifer » Tue Oct 07, 2014 12:33 pm

OLS and ML are only asymptotically equivalent. Given your few observations, some difference is expected.
------------
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: Estimating Solow residuals in Dynare 4.3.3

Postby kyri82 » Tue Oct 07, 2014 4:46 pm

Of course...
kyri82
 
Posts: 141
Joined: Thu Feb 10, 2011 6:14 pm
Location: Toulouse - France

Re: Estimating Solow residuals in Dynare 4.3.3

Postby jpfeifer » Wed Oct 08, 2014 6:50 am

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.
------------
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: Estimating Solow residuals in Dynare 4.3.3

Postby kyri82 » Thu Oct 09, 2014 11:01 am

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.
kyri82
 
Posts: 141
Joined: Thu Feb 10, 2011 6:14 pm
Location: Toulouse - France

Re: Estimating Solow residuals in Dynare 4.3.3

Postby jpfeifer » Fri Oct 10, 2014 5:08 am

I have sent the files to your email address.
------------
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


Return to Dynare help

Who is online

Users browsing this forum: No registered users and 13 guests