outliers.regressors {tsoutliers} | R Documentation |
Regressor Variables for the Detection of Outliers
Description
These functions create regressor variables to be used included in the regression where tests for presence will be applied.
Usage
outliers.regressors(pars, mo, n, weights = TRUE,
delta = 0.7, freq = 12)
Arguments
pars |
a list containing the parameters of the model.
See details section in |
mo |
a data frame defining the type, location and weight of the outliers to be created. |
n |
a numeric. The length of the variable that will contain the outlier. |
weights |
logical. If |
delta |
a numeric. Parameter of the temporary change type of outlier. |
freq |
a numeric. The periodicity of the data.
Used only for the seasonal level shift, |
Details
The variables returned by these functions are the regressors that take part in
the second equation defined in locate.outliers
,
(equation (20) in Chen-Liu (1993), equation (3) in the documentat
attached to the package).
Regressions are not actually run since the t
-statistics
can be obtained more conveniently as indicated in equation (14) in Chen-Liu (1993).
These variables are used in function locate.outliers.iloop
to
adjust the residuals at each iteration.
The function outliers
can be used to easily create the input
argument mo
.
Value
A matrix containing the regressors by columms.
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.
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
,
outliers.tstatistics
, tso
.
Examples
# regression of the residuals from the ARIMA model
# on the corresponding regressors for three additive outliers
# at the 5% level, the first AO is not significant, the others are significant
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)
mo <- outliers(rep("AO", 3), c(10, 79, 224))
xreg <- outliers.regressors(pars, mo, length(y))
summary(lm(residuals(fit) ~ 0 + xreg))