Dear Tom:
I try to code the rpf for tow contries according to your advice to stimulate the Moneta & Ruffer(2009). I have tow quarter GDP series of cn and xj, and want to estimate the dynamic factor.
I have some question:
1: If we suppose autoregression strcture of y and x, how to specify them. In Stock and Watson(1991), "A Probability Model of the Coincident Economic Indicators", they specify the error sturture, otherwise In Moneta and Ruffer(2009), "Business cycyle synchronisation in east Asia", they specify yt=a*yt-1 + Xt +et. which is proper?
2: In Moneta and Ruffer(2009), the state equation Xt=a*Xt-1+nt,they do not specify stucture of Xt or nt, however, I get a straight line. Should I specify Xt to stochastic level or local linear trend,or specify nt for ar(2), or specify varible A ?
3. Stock and Watson(1991) specify ar(2) struture for y and indicators. Should they estimate them before?
4. my propram does work. I do not know how to modify it,Please Tom help me.
Thanks.
Hardmann
Code: Select all
* Moneta and Ruffer(2009), "Business cycyle synchronisation in east Asia"
* Based on thire model, I estimate that one between tow countires,CN & XJ.
* Data are quarterly real GDP and have been seasonally adjusted using X12
*
open data gdp_cn_xj.txt
calendar(q) 1997
data(format=free,org=columns) 1997:1 2012:4 gdp_cn gdp_xj
*
set i_cn = 100.0*log(gdp_cn/gdp_cn{1})
set i_xj = 100.0*log(gdp_xj/gdp_xj{1})
source regcrits.src
source stampdiags.src
source bjautofit.src
stats(noprint) i_cn
compute sigma_cn=%variance*.5
stats(noprint) i_xj
compute sigma_xj=%variance*.5
*
graph(footer="CN & XJ growth rate",key=upleft) 2
# i_cn
# i_xj
* Parameters for index
*
dec real sigma_f
compute sigma_f=0.0
* Construct fixed parts of the A matrix
dec real
compute f=1.0
dec rect c(1,2)
compute c=||1.0,1.0||
dec real a_cn a_xj
compute a_cn=0.0
compute a_xj=0.0
dec frml[vect] yf
frml yf = ||i_cn,i_xj ||
dec frml[vect] muf
frml muf = ||-a_cn*i_cn{1},-a_xj*i_xj{1} ||
nonlin a_cn a_xj sigma_cn sigma_xj
*
dlm(y=yf,mu=muf,sv=%diag(||sigma_cn^2,sigma_xj^2||),c=c,a=1.0,f=1.0,$
sw=sigma_f,presample=ergodic,type=filter,exact,$
method=bfgs) 1997:2 * xstates
*
set indicator_f 1997:2 * = xstates(t)(1)
acc indicator_f
graph(footer="Coincident Indicator, Filtered Version")
# indicator_f