Forces other than the intervention under investigation influenced the dependent variable
Could add a no-treatment time series from a control group
Use qualitative or quantitative means to examine plausible effect-causing events
Instrumentation – how was data collected/recorded
Selection – did the composition of the experimental group change at the time of intervention?
Poorly specified intervention point; diffusion
Choice of outcome – usually have only routinely collected data
Power, violated test assumptions, unreliability of measurements, reactivity etc.
basic types of interventions
model without intervention
model with intervention
where is the amount of change at time that is attributed to
the intervention. By definition is 0 before .
Permanent constant change to the mean level: An amount has been added (or subtracted) to each value after time T.
Constant change after time T may be written simply as:
where
when
Overall intervention model:
when
Brief constant change to the mean level: There may be a temporary change for one or more periods, after which there is no effect of the intervention.
Brief change after time T may be written simply as:
where
when
Overall intervention model:
when
Gradually increasing/decreasing which levels off.
Change after time T may be written simply as:
Overall intervention model:
where
Immediate change which returns to original level.
Change after time T may be written simply as:
Overall intervention model:
where
when
USEFUL in explaining the effect of an intervention and so they help improve forecast accuracy after an intervention.
LIMITED VALUE in forecasting the effect of an intervention before it occurs as we cannot estimate (because of the lack of data) the parameters of the intervention model.
in
Seems like a series that is generally stationary, but shifts level around t=200.
Looks like two separate leveled series before and after t=200.
Examine separately at the parts before and after the level shift. There are in total 400 time-points. Select the first 190 and the last 190 observations.
Stationary data
AR(1)?
MA(1)?
ARMA(1,0,1)?
Stationary data
ARMA(1,0,1)!
A STEP function
Seems to be a permanent, immediate, and constant change in level at t = 200
Let:
Our model is:
ARIMA(1,0,1)
strange.model <-arimax(strange,order=c(1,0,1),
xtransf=data.frame(step200=1*(seq(strange)>=200)),
transfer=list(c(0,0)))
To model the intervention model using TSA library
strange.model <-arimax(strange,order=c(1,0,1),
xtransf=data.frame(step200=1*(seq(strange)>=200)),
transfer=list(c(0,0)))
print(strange.model)
Series: strange
ARIMA(1,0,1) with non-zero mean
Coefficients:
ar1 ma1 intercept step200-MA0
0.9824 -1.0000 10.0026 1.9958
s.e. 0.0111 0.0064 0.0350 0.0606
sigma^2 estimated as 0.9826: log likelihood=-564.82
AIC=1137.64 AICc=1137.79 BIC=1157.6
Thus, our model is:
Seems to be some auto-correlation left in the residuals.
Try an ARMA(1,0,2)
strange.model2 <-arimax(strange,order=c(1,0,2),
xtransf=data.frame(step200=1*(seq(strange)>=200)),
transfer=list(c(0,0)))
Series: strange
ARIMA(1,0,2) with non-zero mean
Coefficients:
ar1 ma1 ma2 intercept step200-MA0
0.9730 -0.7781 -0.2219 10.0012 1.9972
s.e. 0.0133 0.0525 0.0521 0.0317 0.0557
sigma^2 estimated as 0.9406: log likelihood=-556.28
AIC=1122.56 AICc=1122.77 BIC=1146.5
plot(y=strange,x=seq(strange),type="l",xlab="Time")
lines(y=fitted(strange.model),x=seq(strange),col="blue", lwd=2)
lines(y=fitted(strange.model2),x=seq(strange),col="red", lwd=1)
legend("bottomright",legend=c("original","model1","model2"),
col=c("black","blue","red"),lty=1,lwd=c(1,2,1))
Changes to a procedure, or law, or policy
Crisis, Man-made/ natural disasters
Source: ARIMA Modeling With Intervention to Forecast and Analyze Chinese Stock Prices
Source: Intervention analysis of inbound tourism: A case study of Taiwan
Source: Intervention time series analysis of crime rates: the impact of sentence reforms in Virginia
Source: R-bloggers.com
year month approve t s11
1 2001 1 45.41947 1 0
2 2001 2 55.83721 2 0
3 2001 3 55.91828 3 0
4 2001 4 58.12725 4 0
5 2001 5 55.79231 5 0
.
.
.
#libraries
rm(list=ls())
library(foreign)
library(TSA)
setwd('/Users/wkuuser/Desktop/briefcase/R Data Sets') # mac
#load data & view series
bush <- read.dta("BUSHJOB.DTA")
names(bush)
print(bush)
plot(y=bush$approve, x=bush$t, type='l')
#identify arima process
acf(bush$approve)
pacf(bush$approve)
#estimate arima model
mod.1 <- arima(bush$approve, order=c(0,1,0))
mod.1
#diagnose arima model
acf(mod.1$residuals)
pacf(mod.1$residuals)
Box.test(mod.1$residuals)
#Looks like I(1)
#estimate intervention analysis
mod.2 <- arimax(bush$approve, order=c(0,1,0), xtransf=bush$s11, transfer=list(c(1,0)))
mod.2
summary(mod.2)
#Our parameter estimates look good, no need to drop delta or switch to a step function.
#Graph the intervention model
y.diff <- diff(bush$approve)
t.diff <- bush$t[-1]
y.pred <- 24.3741*bush$s11 + 24.3741*(.9639^(bush$t-9))*as.numeric(bush$t>9)
y.pred <- y.pred[-1]
plot(y=y.diff, x=t.diff, type='l')
lines(y=y.pred, x=t.diff, lty=2)
#suppose an AR(1) process
mod.2b <- arimax(bush$approve, order=c(1,0,0), xtransf=bush$s11, transfer=list(c(1,0)));
mod.2b
y.pred <- 58.2875 + 23.6921*bush$s11 + 23.2921*(.8915^(bush$t-9))*as.numeric(bush$t>9)
plot(y=bush$approve, x=bush$t, type='l')
lines(y=y.pred, x=bush$t, lty=2)
Observation 10 represents October 2001, post 9/11/2011.
A DRASTIC shift in the series, that slowly decays and eventually returns to previous levels.
2001/10
"But Mr. Bush enjoyed a high approval rating of 90 percent -- the highest of any president -- following the Sept. 11 attacks in 2001. "
"President Bush [left] office as one of the most unpopular departing presidents in history, according to a new CBS News/New York Times poll showing Mr. Bush's final approval rating at 22 percent."