Last data update: 2014.03.03

R: Test Statistics for the Significance of Outliers
outliers.tstatisticsR Documentation

Test Statistics for the Significance of Outliers

Description

This function computes the t-statistics to assess the significance of different types of outliers at every possible time point. The statistics can be based either on an ARIMA model, arima, auto.arima, or a structural time series model, stsmFit.

Usage

outliers.tstatistics(pars, resid, types = c("AO", "LS", "TC"), 
  sigma = NULL, delta = 0.7, n.start = 50)




Arguments

pars

a list containing the parameters of the model. See details section in locate.outliers.

resid

a time series. Residuals of the ARIMA model fitted to the data.

types

a character vector indicating the types of outliers to be considered.

sigma

a numeric or NULL. Standard deviation of residuals.

delta

a numeric. Parameter of the temporary change type of outlier.

n.start

a numeric. The number of warming observations added to the input passed to the Kalman filter. Only for pars of class "stsmSS".

Details

Five types of outliers can be considered. By default: "AO" additive outliers, "LS" level shifts, and "TC" temporary changes are selected; "IO" innovative outliers and "SLS" seasonal level shifts can also be selected.

The test statistics are based on the second equation defined in locate.outliers.

These functions are the called by locate.outliers. The approach described in Chen & Liu (1993) is implemented to compute the t-statistics.

By default (sigma = NULL), the standard deviation of residuals is computed as the mean absolute deviation of resid.

Value

For each function, a two-column matrix is returned. The first column contains the estimate of the coefficients related to the type of outlier and the second column contains the t-statistics. The value of these statistics for each time point is stored by rows, thus the number of rows is equal to the length of resid.

References

Chen, C. and Liu, Lon-Mu (1993). ‘Joint Estimation of Model Parameters and Outlier Effects in Time Series’. Journal of the American Statistical Association, 88(421), pp. 284-297.

G<c3><83><c2><b3>mez, V. and Maravall, A. (1996). Programs TRAMO and SEATS. Instructions for the user. Banco de Espa<c3><83><c2><b1>a, Servicio de Estudios. Working paper number 9628. http://www.bde.es/f/webbde/SES/Secciones/Publicaciones/PublicacionesSeriadas/DocumentosTrabajo/96/Fich/dt9628e.pdf

G<c3><83><c2><b3>mez, V. and Taguas, D. (1995). Detecci<c3><83><c2><b3>n y Correcci<c3><83><c2><b3>n Autom<c3><83><c2><a1>tica de Outliers con TRAMO: Una Aplicaci<c3><83><c2><b3>n al IPC de Bienes Industriales no Energ<c3><83><c2><a9>ticos. Ministerio de Econom<c3><83><c2><ad>a y Hacienda. Document number D-95006. http://www.sepg.pap.minhap.gob.es/sitios/sepg/es-ES/Presupuestos/Documentacion/Documents/DOCUMENTOS%20DE%20TRABAJO/D95006.pdf

Kaiser, R., and Maravall, A. (1999). Seasonal Outliers in Time Series. Banco de Espa<c3><83><c2><b1>a, Servicio de Estudios. Working paper number 9915. http://www.bde.es/f/webbde/SES/Secciones/Publicaciones/PublicacionesSeriadas/DocumentosTrabajo/99/Fic/dt9915e.pdf

See Also

locate.outliers, outliers.regressors.

Examples

# given an ARIMA model detect potential outliers
# for a critical value equal to 3.5
data("hicp")
y <- log(hicp[["011600"]])
fit <- arima(y, order = c(1, 1, 0), seasonal = list(order = c(2, 0, 2)))
resid <- residuals(fit)
pars <- coefs2poly(fit)
tstats <- outliers.tstatistics(pars, resid)
# potential observations affected by an additive outliers
which(abs(tstats[,"AO","tstat"]) > 3.5)
# potential observations affected by a temporary change
which(abs(tstats[,"TC","tstat"]) > 3.5)
# potential observations affected by a level shift
which(abs(tstats[,"LS","tstat"]) > 3.5)

Results