a question on business cycle synchronization

Discussion of State Space and Dynamic Stochastic General Equilibrium Models
hardmann
Posts: 252
Joined: Sat Feb 26, 2011 9:49 pm

a question on business cycle synchronization

Unread post by hardmann »

Dear Tom:
I study business cycle synchornization between countries. I simply modify the code of Stock and Watson(1991), "A Probability Model of the Coincident Economic Indicators," for two countries.
I get gamma(1)=2.5>1, is it right? I exchange the order of tow series, gamma(1) is still more than 2.
first : i_cn i_xj

Code: Select all

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})

*
* Parameters for index
*
dec vect phi(2)
compute phi=%zeros(2,1)
dec real sigmac
compute sigmac=1.0
*
* Parameters for the series. sigma is initialized based upon the sample
* means.
*
dec vect beta(2) gamma(2)
dec vect sigma(2)
dec vect[vect] d(2)
ewise d(i)=%zeros(2,1)
*
compute gamma=%const(1.0)
stats(noprint) i_cn
compute beta(1)=%mean,sigma(1)=%variance*.5
stats(noprint) i_xj
compute beta(2)=%mean,sigma(2)=%variance*.5

*
* Construct fixed parts of the A matrix
*
dec rect a(6,6)
compute ar2=||0.0,0.0|1.0,0.0||
compute a=ar2~\ar2~\ar2
*
* Construct the F matrix (always fixed)
*
dec rect f(6,3)
compute f2=||1.0|0.0||
compute f=f2~\f2~\f2
*
* Construct the fixed parts of the C matrix
*
dec rect c(6,2)
compute c=%zeros(2,2)~~(f2~\f2)
*
dec symm sw(3,3)
*
function %%DLMSetup
compute %psubmat(a,1,1,tr(phi))
do i=1,2
   compute %psubmat(a,2*i+1,2*i+1,tr(d(i)))
end do i
compute %psubmat(c,1,1,tr(gamma))
compute sw=%diag(sigmac~~sigma)
end %%DLMSetup
*

*
dec frml[vect] yf
frml yf = ||i_cn-beta(1),i_xj-beta(2) ||
*
* Estimate the parameters by maximum likelihood.
*
nonlin gamma d sigma phi
*
dlm(start=%%DLMSetup(),y=yf,sw=sw,c=c,a=a,f=f,$
   presample=ergodic,type=filter,$
   pmeth=simplex,piters=200,method=bfgs) 1997:2 * xstates


*
* As this is constructed, it somewhat arbitrarily fixes the pre-sample
* value of the indicator at zero.
*
set indicator_f 1997:2 * = xstates(t)(1)
acc indicator_f
graph(footer="Coincident Indicator, Filtered Version")
# indicator_f
*
dlm(start=%%DLMSetup(),y=yf,sw=sw,c=c,a=a,f=f,presample=ergodic,$
   type=smooth,print,title="smooth") 1997:2 * xstates


set indicator_m 1997:2 * = xstates(t)(1)
acc indicator_m
graph(footer="Coincident Indicator, Smoothed Version")
# indicator_m



second : i_xj i_cn

Code: Select all

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})

*
* Parameters for index
*
dec vect phi(2)
compute phi=%zeros(2,1)
dec real sigmac
compute sigmac=1.0
*
* Parameters for the series. sigma is initialized based upon the sample
* means.
*
dec vect beta(2) gamma(2)
dec vect sigma(2)
dec vect[vect] d(2)
ewise d(i)=%zeros(2,1)
*
compute gamma=%const(1.0)
stats(noprint) i_cn
compute beta(2)=%mean,sigma(2)=%variance*.5
stats(noprint) i_xj
compute beta(1)=%mean,sigma(1)=%variance*.5

*
* Construct fixed parts of the A matrix
*
dec rect a(6,6)
compute ar2=||0.0,0.0|1.0,0.0||
compute a=ar2~\ar2~\ar2
*
* Construct the F matrix (always fixed)
*
dec rect f(6,3)
compute f2=||1.0|0.0||
compute f=f2~\f2~\f2
*
* Construct the fixed parts of the C matrix
*
dec rect c(6,2)
compute c=%zeros(2,2)~~(f2~\f2)
*
dec symm sw(3,3)
*
function %%DLMSetup
compute %psubmat(a,1,1,tr(phi))
do i=1,2
   compute %psubmat(a,2*i+1,2*i+1,tr(d(i)))
end do i
compute %psubmat(c,1,1,tr(gamma))
compute sw=%diag(sigmac~~sigma)
end %%DLMSetup
*
*
dec frml[vect] yf
frml yf = ||i_xj-beta(1),i_cn-beta(2) ||
*
* Estimate the parameters by maximum likelihood.
*
nonlin gamma d sigma phi
*
dlm(start=%%DLMSetup(),y=yf,sw=sw,c=c,a=a,f=f,$
   presample=ergodic,type=filter,$
   pmeth=simplex,piters=10,method=bfgs) 1997:2 * xstates
*

*

*
set indicator_f 1997:2 * = xstates(t)(1)
acc indicator_f
graph(footer="Coincident Indicator, Filtered Version")
# indicator_f
*
dlm(start=%%DLMSetup(),y=yf,sw=sw,c=c,a=a,f=f,presample=ergodic,$
   type=smooth) 1997:2 * xstates
set indicator_m 1997:2 * = xstates(t)(1)
acc indicator_m
graph(footer="Coincident Indicator, Smoothed Version")
# indicator_m
Attachments
gdp_cn_xj.txt
data file
(1.55 KiB) Downloaded 861 times
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: a question on business cycle synchornization

Unread post by TomDoan »

hardmann wrote:Dear Tom:
I study business cycle synchornization between countries. I simply modify the code of Stock and Watson(1991), "A Probability Model of the Coincident Economic Indicators," for two countries.
I get gamma(1)=2.5>1, is it right? I exchange the order of tow series, gamma(1) is still more than 2.
Why would you think there's a problem? GAMMA's are loadings from the cycles onto the series. Since (for normalization) the variance of the shock to the cycle is standardized to one, the scale of gamma can be anything depending upon the values of your dependent variables.
hardmann
Posts: 252
Joined: Sat Feb 26, 2011 9:49 pm

Re: a question on business cycle synchornization

Unread post by hardmann »

Dear Tom:
Thanks. I am still confused. We estimate first model with order i_cn, i_xj,gamma(1) of i_cn=2.5>1, gamma(2) of i_xj<1, while second model with order i_xj, i_cn, gamma(1) of i_xj =2.7>1, gamma(2) of i_cn<1, which is right?

Best regard
Hardmann
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: a question on business cycle synchornization

Unread post by TomDoan »

Probably neither. This isn't a model which is likely to handle well two series which, at least from graphical inspection don't seem to have any strong common cycle. You have an AR(2) on the unobserved cycle, plus AR(2) noise processes for each series. That's quite a bit of action for two series. If they were more closely linked, it might work, but probably not with the two that you have.
Post Reply