Sinclair(2009) JMCB

Use this forum for posting example programs or short bits of sample code.

Sinclair(2009) JMCB

Postby TomDoan » Mon Nov 02, 2009 6:41 pm

Replication of Sinclair(2009), "The Relationships between Permanent and Transitory Movements in U.S. Output and the Unemployment Rate," Journal of Money, Credit and Banking, vol. 41(2-3), pages 529-542. This extends the unobserved components model with correlated shocks and trend break of Perron and Wada(2009) (http://www.estima.com/forum/viewtopic.php?f=8&t=1504) to a bivariate system with GDP and unemployment.

This also estimates univariate models in hopes of producing guess values for the joint model. The estimation of the model is rather touchy, as there are several local modes. This reproduces the results in the paper...by feeding in the results in the paper. Note that the author's Gauss code does the same thing, so locating the global optimum must be quite difficult. The univariate models end up not helping much, since the two models end up with shocks that are almost perfectly (negatively) correlated, so there's quite a bit of cross variable information.

sinclair.rpf
Program file
(5.79 KiB) Downloaded 187 times

newugdp232.dat
Data file
(3.79 KiB) Downloaded 184 times
TomDoan
 
Posts: 2717
Joined: Wed Nov 01, 2006 5:36 pm

Re: Sinclair’s paper, JMCB, 2009

Postby unforgiven02 » Tue Nov 03, 2009 5:54 pm

Thank you very much Tom Doan for your help and Todd Clark for your comment. It's a great contribution..but when i run the program, Rats has closed itself, i tried many times but result is the same so i wasn't able to replicate the model using rats program. The version i'am using is 7.0, is this happen due to the version incompatibility?

Best.
unforgiven02
 
Posts: 10
Joined: Sat May 16, 2009 1:26 pm

Re: Sinclair’s paper, JMCB, 2009

Postby condor » Fri Nov 06, 2009 7:29 am

I encountered the same problem. As far as I understand, the problem seems to occur from the following specification:
Code: Select all
* This estimates the model with the pre-sample conditions used in the paper
*
dlm(start=DLMYUModelSetup(),a=ayu,z=zyu,sw=swyu,c=cyu,f=fyu,y=||lgdp,ur||,$
  x0=x0,sx0=sx0,condition=4,parmset=jparms,pmethod=simplex,piters=5,method=bfgs,type=smooth)

It may seem a little bit ironic, but the code works perfectly if you skip these lines and estimate the model "with the more technically correct handling".
condor
 
Posts: 15
Joined: Fri Apr 10, 2009 4:11 pm

Re: Sinclair’s paper, JMCB, 2009

Postby unforgiven02 » Sat Nov 07, 2009 3:57 am

Even if i skip the lines shown by condor, the problem occurs again, the code doesn't work and rats shut down itself. I'm running rats line by line and rats shut down between the lines 55-60 before the lines condor indicated.
unforgiven02
 
Posts: 10
Joined: Sat May 16, 2009 1:26 pm

Re: Sinclair’s paper, JMCB, 2009

Postby moderator » Mon Nov 09, 2009 11:26 am

You'll need version 7.2 (or later) to run that code. Version 7.2 includes a fix for the bug that causes that DLM instruction to fail.

Regards,
Tom Maycock
moderator
Site Admin
 
Posts: 306
Joined: Thu Oct 19, 2006 4:33 pm

Re: Sinclair(2009) JMCB

Postby mskare69 » Tue Mar 12, 2013 12:45 pm

Dear Tom,

I run the code for the Sinclair (2009) but the results are not fully the same and also output in rats is missing the cross correlation part of the table from Sinclair paper? Any suggestions how to exactly replicate the results and get the cross correlation results as in the paper?

Fondly,

Marinko
mskare69
 
Posts: 18
Joined: Tue May 10, 2011 3:35 pm

Re: Sinclair(2009) JMCB

Postby TomDoan » Tue Mar 12, 2013 1:11 pm

mskare69 wrote:Dear Tom,

I run the code for the Sinclair (2009) but the results are not fully the same and also output in rats is missing the cross correlation part of the table from Sinclair paper? Any suggestions how to exactly replicate the results and get the cross correlation results as in the paper?

Fondly,

Marinko


Each model (with and without the break) is estimated both with the handling of the unit roots done in the paper and with the more correct handling of them. The first in each set appears to reproduce the published results exactly, though we wouldn't recommend using that technique. The second set don't reproduce the results, and aren't intended to.

After any of the four DLM estimations

disp %cvtocorr(swyu)

will compute the correlations among the innovations.
TomDoan
 
Posts: 2717
Joined: Wed Nov 01, 2006 5:36 pm

Re: Sinclair(2009) JMCB

Postby mskare69 » Wed Mar 13, 2013 11:35 am

Dear Tom,

thanks for a fast reply, I get it now. Another question, how do I get the numbers to fill in (input cvinput) and part of the code below (I am new to state space, red your state space course materials but still miss few points).

dec symm cvinput(4,4)
input cvinput
1.0
-.8566 1.0
-.9330 +.8501 1.0
+.9397 -.9562 -.9666 1.0
compute swfactor=%decomp(%corrtocv(cvinput,||1.4534,.9620,.6889,.6462||.^2))
compute mu_y=.8421,ph1_y=.7431,ph2_y=-.2656
compute mu_u=.0000,ph1_u=.7012,ph2_u=-.1791

Fondly,

Marinko
mskare69
 
Posts: 18
Joined: Tue May 10, 2011 3:35 pm

Re: Sinclair(2009) JMCB

Postby TomDoan » Wed Mar 13, 2013 12:18 pm

There are comments in the code about the guess values. They came out of Sinclair's Gauss program, and represent nearly converged values for the parameters. The model is extremely hard to fit and quite honestly, I never came up with a reasonable process for starting with simple guess values. What are shown are probably the result of considerable trial-and-error which isn't shown in the program.
TomDoan
 
Posts: 2717
Joined: Wed Nov 01, 2006 5:36 pm

Re: Sinclair(2009) JMCB

Postby mskare69 » Thu Mar 14, 2013 2:14 am

Dear Tom,

I found this parameter initial values in the Sinclair original Gauss code

PRMTR_IN={ 4.000173 3.646685 1.267028 0.4 0.450644 0.208434 1.4 -0.179 -0.67 -0.919887 0.842129 0.591248 -0.2 0.5 -0.4};@-277.040573 @
@ use above starting values to eliminate imaginary standard errors and to match estimates in paper@

Values are quite different from the one in the rats code so I am not sure what are the input lines for the parameter values in the rats code and why the values differ from the Gauss one?

Fondly,

Marinko
mskare69
 
Posts: 18
Joined: Tue May 10, 2011 3:35 pm

Re: Sinclair(2009) JMCB

Postby TomDoan » Thu Mar 14, 2013 7:06 am

She uses a very different parameterization for the covariance matrix---the RATS code uses a Choleski factor which avoids problems with the matrix going non-positive-definite. If you're trying to learn how to get guess values for the model, the person to contact would be Prof. Sinclair.
TomDoan
 
Posts: 2717
Joined: Wed Nov 01, 2006 5:36 pm

Re: Sinclair(2009) JMCB

Postby mskare69 » Thu Mar 14, 2013 3:46 pm

Dear Tom,

Thanks for help, can you suggest me how to perform state space modeling on nonstationary data? Something as Aoki algorithm or else?

Fondly,

Marinko
mskare69
 
Posts: 18
Joined: Tue May 10, 2011 3:35 pm

Re: Sinclair(2009) JMCB

Postby condor » Fri Mar 15, 2013 6:53 am

There are very nice papers here on this subject: http://www.estima.com/resources_articles.shtml
condor
 
Posts: 15
Joined: Fri Apr 10, 2009 4:11 pm

Re: Sinclair(2009) JMCB

Postby TomDoan » Fri Mar 15, 2013 6:59 am

mskare69 wrote:Dear Tom,

Thanks for help, can you suggest me how to perform state space modeling on nonstationary data? Something as Aoki algorithm or else?

Fondly,

Marinko


Almost every example we have of state-space modeling is on non-stationary data. The unobservable components models in the state-space modeling textbooks (Durbin-Koopman, Commandeur-Koopman, Harvey and West-Harrison) are non-stationary.
TomDoan
 
Posts: 2717
Joined: Wed Nov 01, 2006 5:36 pm

Re: Sinclair(2009) JMCB - three variable model

Postby mskare69 » Tue Mar 19, 2013 12:35 pm

Dear Tom,

What would be the right way to include a third variable in the original Sinclair code? Can you help me with the code you already wrote for rats so as to include prices in the model? I would try to include a third variable estimating the relationship between permanent and transitory movements in output, unemployment rate and prices and the relationship between them (but I need your help on the code).

Thanks,

Marinko
mskare69
 
Posts: 18
Joined: Tue May 10, 2011 3:35 pm

Next

Return to Examples and Sample Code

Who is online

Users browsing this forum: No registered users and 1 guest