detectAO: Additive Outlier Detection

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/detectAO.R

Description

This function serves to detect whether there are any additive outliers (AO). It implements the test statistic lambda_{2,t} proposed by Chang, Chen and Tiao (1988).

Usage

1
detectAO(object, alpha = 0.05, robust = TRUE)

Arguments

object

a fitted ARIMA model

alpha

family significance level (5% is the default) Bonferroni rule is used to control the family error rate.

robust

if true, the noise standard deviation is estimated by mean absolute residuals times sqrt(pi/2). Otherwise, it is the estimated by sqrt(sigma2) from the arima fit.

Value

A list containing the following components:

ind

the time indices of potential AO

lambda2

the corresponding test statistics

Author(s)

Kung-Sik Chan

References

Chang, I.H., Tiao, G.C. and C. Chen (1988). Estimation of Time Series Parameters in the Presence of Outliers. Technometrics, 30, 193-204.

See Also

detectIO

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
set.seed(12345)
y=arima.sim(model=list(ar=.8,ma=.5),n.start=158,n=100)
y[10]
y[10]=10
y=ts(y,freq=1,start=1)
plot(y,type='o')
acf(y)
pacf(y)
eacf(y)
m1=arima(y,order=c(1,0,0))
m1
detectAO(m1)
detectAO(m1, robust=FALSE)
detectIO(m1)

Example output

Loading required package: leaps
Loading required package: locfit
locfit 1.5-9.1 	 2013-03-22
Loading required package: mgcv
Loading required package: nlme
This is mgcv 1.8-20. For overview type 'help("mgcv-package")'.
Loading required package: tseries

Attaching package: 'TSA'

The following objects are masked from 'package:stats':

    acf, arima

The following object is masked from 'package:utils':

    tar

[1] -2.126153
AR/MA
  0 1 2 3 4 5 6 7 8 9 10 11 12 13
0 x x o o o o o o o o o  o  o  o 
1 o o o o o o o o o o o  o  o  o 
2 o o o o o o o o o o o  o  o  o 
3 o x o o o o o o o o o  o  o  o 
4 o x o o o o o o o o o  o  o  o 
5 x x o o o o o o o o o  o  o  o 
6 x o o o o o o o o o o  o  o  o 
7 o x o o o o o o o o o  o  o  o 

Call:
arima(x = y, order = c(1, 0, 0))

Coefficients:
         ar1  intercept
      0.5419     0.7096
s.e.  0.0831     0.3603

sigma^2 estimated as 2.788:  log likelihood = -193.33,  aic = 390.65
             [,1]      [,2]      [,3]
ind      9.000000 10.000000 11.000000
lambda2 -4.018412  9.068982 -4.247367
             [,1]
ind     10.000000
lambda2  7.321709
             [,1]     [,2]
ind     10.000000 11.00000
lambda1  7.782013 -4.67421

TSA documentation built on July 2, 2018, 1:04 a.m.