outliers.tstatistics {tsoutliers} | R 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
or auto.arima
.
Usage
outliers.tstatistics(pars, resid, types = c("AO", "LS", "TC"),
sigma = NULL, delta = 0.7)
Arguments
pars |
a list containing the parameters of the model.
See details section in |
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 |
delta |
a numeric. Parameter of the temporary change type of outlier. |
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ómez, V. and Maravall, A. (1996). Programs TRAMO and SEATS. Instructions for the user. Banco de España, Servicio de Estudios. Working paper number 9628. http://www.bde.es/f/webbde/SES/Secciones/Publicaciones/PublicacionesSeriadas/DocumentosTrabajo/96/Fich/dt9628e.pdf
Gómez, V. and Taguas, D. (1995). Detección y Corrección Automática de Outliers con TRAMO: Una Aplicación al IPC de Bienes Industriales no Energéticos. Ministerio de Economía y Hacienda. Document number D-95006. https://www.sepg.pap.hacienda.gob.es/sitios/sepg/es-ES/Presupuestos/DocumentacionEstadisticas/Documentacion/Documents/DOCUMENTOS%20DE%20TRABAJO/D95006.pdf
Kaiser, R., and Maravall, A. (1999). Seasonal Outliers in Time Series. Banco de Españ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)