I am trying to build and estimate a univariate state-space model in Stata using the sspace command.
Everything works fine so far, but I do not know how to include an intervention variable.
Let's take the example from the sspace help file
and assume that a special event took place in 1981 for which I want to account through the following intervention variable:
My question is: how to I include this intervention variable in the code for the state-state model? More formally, how do I extend the model
\[ \Delta lncaputil_t = u_t + \beta_t \\ u_t = \alpha u_{t-1} + \epsilon_t \] to
\[ \Delta lncaputil_t = u_t + \beta_t intv_t \\ u_t = \alpha u_{t-1} + \epsilon_t \\ \beta_t = \beta_{t-1} + v_t \] ?
Thanks in advanced for your help.
Everything works fine so far, but I do not know how to include an intervention variable.
Let's take the example from the sspace help file
Code:
webuse manufac constraint 1 [D.lncaputil]u = 1 sspace (u L.u, state noconstant) (D.lncaputil u, noerror), constraints(1)
Code:
gen intv = 0 replace intv = 1 if inrange(month, tm(1981m1), tm(1981m12))
\[ \Delta lncaputil_t = u_t + \beta_t \\ u_t = \alpha u_{t-1} + \epsilon_t \] to
\[ \Delta lncaputil_t = u_t + \beta_t intv_t \\ u_t = \alpha u_{t-1} + \epsilon_t \\ \beta_t = \beta_{t-1} + v_t \] ?
Thanks in advanced for your help.