SSM TVC
Posted: Fri Nov 09, 2018 2:42 pm
Hi Tom,
I follow the SSM example but fail to estimate the simple linear model as below:
Measurement: du(t) = beta0 + beta1(t)*dy(t) + e(t)
State: beta1(t) = beta1(t-1) + v(t)
That is I don't want beta0 varying over time, thus only beta1(t) is time-varying.
I use option MU = beta0 as follows:
But the estimated beta1(t) aren't the expected ones obtained from the equivalent EViews SSM code:
What I want is the smooth state of beta (SV1) as in the EV SSM model.
Where am I wrong with DLM?
Many thanks.
I follow the SSM example but fail to estimate the simple linear model as below:
Measurement: du(t) = beta0 + beta1(t)*dy(t) + e(t)
State: beta1(t) = beta1(t-1) + v(t)
That is I don't want beta0 varying over time, thus only beta1(t) is time-varying.
I use option MU = beta0 as follows:
Code: Select all
LINREG(DEFINE=SSM_MOD) DU
# DY
declare vect sigmav
declare real sigmae
declare real beta0
compute sigmae = 0.5*sqrt(%seesq)
compute sigmav = 0.01*%stderrs
compute bete0 = 0
nonlin sigmae sigmav beta0
* Two variables DU, DY are stationary so I use ERGODIC option
dlm(y=DU,c=%eqnxvector(SSM_MOD,t),mu=beta0,sw=%diag(sigmav^2),sv=sigmae^2,$
presample=ergodic,method=solve,type=smooth) / xstates vstates
set beta_tvc = xstates(t)(1)
Code: Select all
@signal du = c(1) + sv1*dy + [var=exp(c(2))]
@state sv1 = sv1(-1) + [var=exp(c(3))]
Where am I wrong with DLM?
Many thanks.