Page 1 of 2

Sinclair(2009) JMCB

Posted: Mon Nov 02, 2009 5:41 pm
by TomDoan
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) 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.

This requires RATS 7.2 or later.
sinclair.rpf
Program file
(5.79 KiB) Downloaded 1543 times
newugdp232.dat
Data file
(3.79 KiB) Downloaded 1503 times

Re: Sinclair’s paper, JMCB, 2009

Posted: Fri Nov 06, 2009 6:29 am
by condor
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".

Re: Sinclair(2009) JMCB

Posted: Tue Mar 12, 2013 12:45 pm
by mskare69
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

Re: Sinclair(2009) JMCB

Posted: Tue Mar 12, 2013 1:11 pm
by TomDoan
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.

Re: Sinclair(2009) JMCB

Posted: Wed Mar 13, 2013 11:35 am
by mskare69
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

Re: Sinclair(2009) JMCB

Posted: Wed Mar 13, 2013 12:18 pm
by TomDoan
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.

Re: Sinclair(2009) JMCB

Posted: Thu Mar 14, 2013 2:14 am
by mskare69
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

Re: Sinclair(2009) JMCB

Posted: Thu Mar 14, 2013 7:06 am
by TomDoan
She uses a very different parameterization for the covariance matrix---the RATS code uses a Cholesky 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.

Re: Sinclair(2009) JMCB

Posted: Thu Mar 14, 2013 3:46 pm
by mskare69
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

Re: Sinclair(2009) JMCB

Posted: Fri Mar 15, 2013 6:53 am
by condor
There are very nice papers here on this subject: http://www.estima.com/resources_articles.shtml

Re: Sinclair(2009) JMCB

Posted: Fri Mar 15, 2013 6:59 am
by TomDoan
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.

Re: Sinclair(2009) JMCB - three variable model

Posted: Tue Mar 19, 2013 12:35 pm
by mskare69
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

Re: Sinclair(2009) JMCB - three variable model

Posted: Tue Mar 19, 2013 1:34 pm
by TomDoan
mskare69 wrote: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
Given that the model with two observables is extremely difficult to estimate, adding a third doesn't seem very practical. In the bivariate model, the only connection between GDP and unemployment are the correlated shocks to the components. If you extend that to a trivariate model, you would need to define the model for the price variable, which takes the same form as the other two, extend to three components the diagonal concatenations and the individual model setups in

Code: Select all

compute fyu=fy~\fu
compute cyu=cy~\cu
****
function DLMYUModelSetup
*
* Set up the individual models
*
compute DLMYModelSetup()
compute DLMUModelSetup()
*
* Combine the A matrices by diagonal concatenation
*
compute ayu=ay~\au
*
* Multiply out the factor matrix to get covariance matrix
*
compute swyu=%ltouterxx(swfactor)
end DLMYUModelSetup
****
Extend

frml zyu = zy~~zu

to a third component and change SWFACTOR to a 6 x 6 matrix rather than 4 x 4.

Re: Sinclair(2009) JMCB

Posted: Thu Apr 03, 2014 6:59 pm
by AhmedSahlool
Dear Tom,

I hope this finds you well,

I need your help concerning the code of the bivariate model of Sinclair (2009).

I wanted to know how he found the initial values of the model. I contacted mr. Sinclair who replied as follows:

"The best way to find appropriate initial values is to do a search with a random number generator to find the global maximum. You can just put a loop around the whole program and try around 100 different randomly drawn vectors - then take the results with the highest likelihood value".

Could you help how to implement this within the code.

Thank you and best regards.

Ahmed Sahloul

Re: Sinclair(2009) JMCB

Posted: Thu Apr 03, 2014 9:16 pm
by TomDoan
PMETHOD=GENETIC is fairly similar to that.