[R] interrupted time series analysis using ARIMA models

Berta ibanez at bioef.org
Mon Mar 6 11:25:30 CET 2006

GlaciarDear R-users, 
Thanks Spencer for your suggestion, i think we are near but still that is not what i am looking for. 
I think I was not clear using that notation for the impact: (yt= d * yt-1 + w * It ), this yt is not my original series, it is only the impact, 
the series would be modeled as Yt=yt +Nt, with yt the impact written above and Nt the ARIMA part of the model. Hence, Yt is the series (your lh), and yt the impact. 

With your suggestion
IntReg <- cbind(It=(1:48)>20, It.w=((1:48)>20)*(1:48),  It.lh=((1:48)>20)*c(0, lh[-48]) )
arima(lh, order = c(1,0,0), xreg=IntReg)

 I would have for the original series Yt=lh(t)

lh(20)=0 + Nt.
lh(21)=w + beta1*21 + beta2*lh(20) + Nt
lh(22)=w + beta1*22 + beta2*lh(21) + Nt

What I am trying to model is a gradual permanent impact, which would lead to:

lh(t)= impact(t) + Nt
lh(t)= w*It + d*yt-1 + Nt

lh(20)= 0+ Nt 
lh(21)= w + Nt
lh(22)= d*w + w + Nt
lh(22)= (d^2)*w + d*w + w + Nt
lh(n)=(d^n)*w +(d^(n-1))*w +....+(d^2)*w + d*w + w + Nt, which asymptoticaly would be = w/(1-d) + Nt.

In that way, I can model the impact not only as an abrupt permanent impact (like a "step") but also as a gradual permanent impact (which grows gradually, as a linear trend or as a parabolic grow trend, or whatever) with just two parameters.  In SAS they are called denominator factors for transfer functions for an input series. I also would like to modelize an abrupt temporary impact (a high pick in the moment of the impact decreasing gradually after it), but hopefully that will be easy after knowing the first.....

Any suggestion for implementing this would be very very well received!!
Thank a lot in advance,


################ answer of Spencer .####################
Does the following illustrate the kind of interevention model you want

IntReg <- cbind(It=(1:48)>20, It.w=((1:48)>20)*(1:48),
               It.lh=((1:48)>20)*c(0, lh[-48]) )
      arima(lh, order = c(1,0,0), xreg=IntReg)
  hope this helps.
  spencer graves

Berta wrote:

> Hi R-users,
> I am using arima to fit a time series. Now I 
would like to include an intervention component
"It (0 before intervention, 1 after)" using
different types of impacts, that is, not only
trying the simple abrupt permanent impact (yt =
w It ) with the xreg option but also trying with
a gradual permanent impact (yt= d * yt-1 + w * It ),
following the filosophy of Box and Tiao (1975).
Intervention analysis with applications to economic
and environmental problems. JASA 70: 70-92.
> Does anybody know where could I find how to 
incorporate them using the arima comand (or other),
or a statistical package which can incorporate it?
> Thanks, 
> Berta.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://stat.ethz.ch/pipermail/r-help/attachments/20060306/1c02153a/attachment-0003.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/jpeg
Size: 2743 bytes
Desc: not available
Url : https://stat.ethz.ch/pipermail/r-help/attachments/20060306/1c02153a/attachment-0003.jpe 

More information about the R-help mailing list