## Structural Break in the Variance/Covariance Matrix State Space

For technical questions regarding estimation of single equations, systems, VARs, Factor analysis and State Space Models in EViews. General econometric questions and advice should go in the Econometric Discussions forum.

Moderators: EViews Gareth, EViews Moderator

macroWB
Posts: 3
Joined: Tue Jun 09, 2015 7:03 am

### Structural Break in the Variance/Covariance Matrix State Space

Is it possible in the Eviews State Space to incorporate structural change in the variance-covariance matrix? Imagine a simple trend-cycle GDP model but I want to include a break for the great moderation (lower volatility in GDP).

Signals
y = trend + cycle

States
trend = c(1) + trend(-1) + [var=c(10)^2)]
cycle = c(2)*cycle(-1) + c(3)*cycle(-2) + [var=c(20)^2)]

Could I write something along the following lines for the state equations?

States Breaks
trend = c(1) + trend(-1) + [var=(c(10)+c(11)*@during("1960 1984"))^2)]
cycle = c(2)*cycle(-1) + c(3)*cycle(-2) + [var=(c(20)+c(21)*@during("1960 1984"))^2)]

Thanks,

Dave

EViews Glenn
EViews Developer
Posts: 2636
Joined: Wed Oct 15, 2008 9:17 am

### Re: Structural Break in the Variance/Covariance Matrix State Space

I don't have the time to test this right now, but it should work.

All that the variance equation is doing is evaluating the expression to get the appropriate variance for a give observation.

macroWB
Posts: 3
Joined: Tue Jun 09, 2015 7:03 am

### Re: Structural Break in the Variance/Covariance Matrix State Space

Thanks for the quick reply Glenn. I had a go at coding up a simple trend/cycle model of US per capita GDP and it seems to work ok. If anyone sees anything that looks wrong with the syntax I have used please comment below.

Thanks again,

Dave

Code: Select all

`'___________________________________________________________________________________________________________________________________________________________________________'  ESTIMATE UNOBSERVED COMPONENT MODELS' Estimates two models:' 1. Simple trend/cycle model of GDP' 2. Simple trend/cycle model of GDP with structural break in variance-covariance matrix'___________________________________________________________________________________________________________________________________________________________________________close @allwfcreate q 1947Q1 2019Q2fetch(d=ffred) a939rx0q048sbeasample ssest 1947q1 2006q4series lgdppc = log(a939rx0q048sbea)*100series dlgdppc = dlog(a939rx0q048sbea)*100series dum_mod = 0smpl @first 1984q4 dum_mod =1 ' Setup coefficient vectorscoef(1) deltacoef(2) phicoef(3) sigmacoef(6) alpha' Establish starting values using frequency domain filter estimates of trend and cyclesmpl @all' HP filterlgdppc.hpf(lamda=1600)  lgdppct_iniseries lgdppcc_ini = lgdppc - lgdppct_ini' Estimate initial coefficients' Trendsmpl ssestequation eq_lgdppct.ls lgdppct_ini =delta(1)+lgdppct_ini(-1)' Store estimates for later use!delta1=delta(1)!sigma1=eq_lgdppct.@se' Cyclesmpl ssestequation eq_phi.ls lgdppcc_ini = phi(1)*lgdppcc_ini(-1) + phi(2)*lgdppcc_ini(-2) ' Store estimates for later use!phi1 = phi(1)!phi2 =phi(2)!sigma2=eq_phi.@se' Estimate simple trend/cycle state space model using HP estimates as starting values (uses MLE)sspace eq_gdpceq_gdpc.append @param delta(1) !delta1 phi(1) !phi1 phi(2) !phi2 sigma(1) !sigma1 sigma(2) !sigma2eq_gdpc.append @signal dlgdppc = delta(1) + ygap0 - ygap1+ [var=(sigma(1)^2)]eq_gdpc.append @state ygap0 = phi(1)*ygap0(-1) + phi(2)*ygap1(-1) + [var=(sigma(2)^2)]eq_gdpc.append @state ygap1 = ygap0(-1)smpl ssesteq_gdpc.ml(optmethod=legacy)eq_gdpc.makestates(t=smooth) *' Estimate simple trend/cycle state space model with structural break in variance-covariance matrixsspace eq_gdpc_breakeq_gdpc_break.append @param delta(1) !delta1 phi(1) !phi1 phi(2) !phi2 sigma(1) !sigma1 sigma(2) !sigma2eq_gdpc_break.append @signal dlgdppc = delta(1) + ygap0 - ygap1+ [var=(sigma(1)+sigma(3)*dum_mod)^2]eq_gdpc_break.append @state ygap0 = phi(1)*ygap0(-1) + phi(2)*ygap1(-1) + [var=(sigma(2)^2)]eq_gdpc_break.append @state ygap1 = ygap0(-1)smpl ssesteq_gdpc_break.mleq_gdpc_break.makestates(t=smooth) *_breakplot ygap0 ygap0_break`

EViews Glenn
EViews Developer
Posts: 2636
Joined: Wed Oct 15, 2008 9:17 am

### Re: Structural Break in the Variance/Covariance Matrix State Space

Looking at the variance specs only, it looks okay to me.