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
Structural Break in the Variance/Covariance Matrix State Space
Moderators: EViews Gareth, EViews Moderator
-
- EViews Developer
- Posts: 2672
- 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.
All that the variance equation is doing is evaluating the expression to get the appropriate variance for a give observation.
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
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 @all
wfcreate q 1947Q1 2019Q2
fetch(d=ffred) a939rx0q048sbea
sample ssest 1947q1 2006q4
series lgdppc = log(a939rx0q048sbea)*100
series dlgdppc = dlog(a939rx0q048sbea)*100
series dum_mod = 0
smpl @first 1984q4
dum_mod =1
' Setup coefficient vectors
coef(1) delta
coef(2) phi
coef(3) sigma
coef(6) alpha
' Establish starting values using frequency domain filter estimates of trend and cycle
smpl @all
' HP filter
lgdppc.hpf(lamda=1600) lgdppct_ini
series lgdppcc_ini = lgdppc - lgdppct_ini
' Estimate initial coefficients
' Trend
smpl ssest
equation eq_lgdppct.ls lgdppct_ini =delta(1)+lgdppct_ini(-1)
' Store estimates for later use
!delta1=delta(1)
!sigma1=eq_lgdppct.@se
' Cycle
smpl ssest
equation 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_gdpc
eq_gdpc.append @param delta(1) !delta1 phi(1) !phi1 phi(2) !phi2 sigma(1) !sigma1 sigma(2) !sigma2
eq_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 ssest
eq_gdpc.ml(optmethod=legacy)
eq_gdpc.makestates(t=smooth) *
' Estimate simple trend/cycle state space model with structural break in variance-covariance matrix
sspace eq_gdpc_break
eq_gdpc_break.append @param delta(1) !delta1 phi(1) !phi1 phi(2) !phi2 sigma(1) !sigma1 sigma(2) !sigma2
eq_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 ssest
eq_gdpc_break.ml
eq_gdpc_break.makestates(t=smooth) *_break
plot ygap0 ygap0_break
-
- EViews Developer
- Posts: 2672
- 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.
Who is online
Users browsing this forum: No registered users and 47 guests