Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • sspace: adding intervention variable

    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
    Code:
    webuse manufac
    constraint 1 [D.lncaputil]u = 1
    sspace (u L.u, state noconstant) (D.lncaputil u, noerror), constraints(1)
    and assume that a special event took place in 1981 for which I want to account through the following intervention variable:
    Code:
    gen intv = 0
    replace intv = 1 if inrange(month, tm(1981m1), tm(1981m12))
    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.
    Last edited by Leon Faerber; 19 Mar 2022, 03:11. Reason: Added tags
Working...
X