RATS 10.1
RATS 10.1

Examples /

INTERVENTION.RPF

Home Page

← Previous Next →

INTERVENTION.RPF is an example of an "intervention" model, which is an ARIMA model with some type of (dummy) shift in the mean. This does both a permanent drop and a temporary drop with a phase out. It demonstrates BOXJENK with the INPUTS option, and also the DUMMY instruction for generating the dummies for the level shifts.

 

We will apply intervention techniques to the S&P 500 (note: not the returns, since there was a large change in the price itself). The shift will take place in October 1987 to deal with the stock market crash on October 19. Because the series we are using consists of monthly averages (not the ideal choice for a serious analysis of this event—daily closing prices would be better), the October, 1987 value does not fully show the decline, since over half the values averaged into the October value were from before the crash. This means that we’re going to need a lag in the numerator, to give the effect two months to take full effect. We’ll also look at two possible ways to model the change: a permanent drop, or a temporary drop with a phase out (see DeLurgio (1998) for another treatment of this same basic example).

 

The permanent effect is done with a level shift starting in 1987:10. The temporary effect is a spike (Additive Outlier) at 1987:10.

 

dummy(ls=1987:10) perm

dummy(ao=1987:10) temp

 

The permanent effect is done with lags 0 and 1 on PERM. DIFF=1,APPLYDIFF are the appropriate options for this where we have a non-stationary series, but the intervention is a change in the level, not the difference.

 

boxjenk(diff=1,applydiff,constant,inputs=1,ma=1) logsp_500 $

   1980:1 1993:12 presids

# perm 1

 

The temporary effect is done with numerator lags 0 and 1 and a single denominator lag (which will create the geometric phase out).

 

boxjenk(diff=1,applydiff,constant,inputs=1,ma=1) logsp_500 $

   1980:1 1993:12 tresids

# temp 1 1


Full Program

 

cal(m) 1947:1
open data haversample.rat
data(format=rats) 1947:1 1993:12 sp500
set logsp_500 = log(sp500)
*
* The permanent effect is done with a level shift starting in 1987:10.
* The temporary effect is a spike at 1987:10.
*
dummy(ls=1987:10) perm
dummy(ao=1987:10) temp
*
* The permanent effect is done with lags 0 and 1 on perm.
*
boxjenk(diff=1,applydiff,constant,inputs=1,ma=1) logsp_500 $
   1980:1 1993:12 presids
# perm 1
*
* The temporary effect is done with numerator lags 0 and 1 and a single
* denominator lag.
*
boxjenk(diff=1,applydiff,constant,inputs=1,ma=1) logsp_500 $
   1980:1 1993:12 tresids
# temp 1 1
 

Output

 

Don’t be deceived by the extremely high t-stat on the D_TEMP{1} coefficient in the second model. It doesn’t mean the second model is better. In fact, the first model is a special case of the second with the coefficient on D_TEMP{1} fixed at 1.0, so the two are almost identical. The results (both models) show a roughly 25% drop in the index through the two month period in October and November, though that's much easier to see in the first model.

 

Box-Jenkins - Estimation by LS Gauss-Newton

Convergence in     6 Iterations. Final criterion was  0.0000075 <=  0.0000100

 

Dependent Variable LOGSP_500, differenced 1 times

Monthly Data From 1980:01 To 1993:12

Usable Observations                       168

Degrees of Freedom                        164

Centered R^2                        0.9954436

R-Bar^2                             0.9953603

Uncentered R^2                      0.9999679

Mean of Dependent Variable       5.4391291443

Std Error of Dependent Variable  0.4591986521

Standard Error of Estimate       0.0312785545

Sum of Squared Residuals         0.1604490677

Log Likelihood                       345.7327

Durbin-Watson Statistic                1.9951

Q(36-1)                               28.6816

Significance Level of Q             0.7657952

 

    Variable                        Coeff      Std Error      T-Stat      Signif

************************************************************************************

1.  CONSTANT                      0.010310788  0.002907481      3.54630  0.00050947

2.  MA{1}                         0.200127855  0.077450051      2.58396  0.01063889

3.  N_PERM{0}                    -0.128493661  0.031743366     -4.04789  0.00007949

4.  N_PERM{1}                    -0.137958367  0.031372235     -4.39747  0.00001963

 

 

Box-Jenkins - Estimation by LS Gauss-Newton

Convergence in    12 Iterations. Final criterion was  0.0000040 <=  0.0000100

 

Dependent Variable LOGSP_500, differenced 1 times

Monthly Data From 1980:01 To 1993:12

Usable Observations                       168

Degrees of Freedom                        163

Centered R^2                        0.9947398

R-Bar^2                             0.9946107

Uncentered R^2                      0.9999630

Mean of Dependent Variable       5.4391291443

Std Error of Dependent Variable  0.4591986521

Standard Error of Estimate       0.0337106133

Sum of Squared Residuals         0.1852340878

Log Likelihood                       333.6666

Durbin-Watson Statistic                1.9723

Q(36-1)                               32.8813

Significance Level of Q             0.5707692

 

    Variable                        Coeff      Std Error      T-Stat      Signif

************************************************************************************

1.  CONSTANT                      0.008715909  0.003419433      2.54893  0.01172839

2.  MA{1}                         0.317061758  0.074340267      4.26501  0.00003377

3.  N_TEMP{0}                     0.001909992  0.020301010      0.09408  0.92515830

4.  N_TEMP{1}                    -0.002947065  0.021264954     -0.13859  0.88994688

5.  D_TEMP{1}                    -0.952734786  0.072001530    -13.23215  0.00000000

 


Copyright © 2025 Thomas A. Doan