Last chance! 50% off unlimited learning
Sale ends in
This functions tests for the significance of a given set of outliers in a time series model that is fitted including the outliers as regressor variables.
discard.outliers(x, y, cval = NULL,
method = c("en-masse", "bottom-up"),
delta = 0.7, tsmethod.call = NULL,
fdiff = NULL, logfile = NULL, check.rank = FALSE)
A list containing the following elements:
xreg
, the variables used as regressors;
xregcoefs
, the coefficients of the outlier regressors;
xregtstats
, the iter
, the number of iterations used by method "en-masse"
;
fit
, the fitted model;
outliers
, the set of outliers after removing those that were not significant.
a list. The output returned by locate.outliers.oloop
.
a time series.
a numeric. The critical value to determine the significance of each type of outlier.
a character. The method to discard/remove outliers. See details.
a numeric. Parameter of the temporary change type of outlier.
an optional call
object. The call to the function used to fit the time
series model.
currently ignored.
a character or NULL
. It is the path to the file where
tracking information is printed. Ignored if NULL
.
logical. If TRUE
, variables generating perfect multicollinearity
are removed (tentative implementation).
In the regressions involved in this function, the variables included as regressors
stand for the effects of the outliers on the data.
These variables are the output returned by outliers.effects
not by outliers.regressors
, which returns the regressors used in the
auxiliar regression where outliers are located
(see second equation defined in locate.outliers
).
The outliers are defined in input x
. If there are regressor variables
in tsmethod.call$xreg
they are considered as other regressor variables
that are included in the regression to test for the significance of outliers.
Given a set of potential outliers detected by locate.outliers
and
locate.outliers.oloop
, three methods are considered in order to
determine which outliers are not significant after refitting the model
(including all the potential outliers):
"en-masse"
: The complete set of outliers is included as regressor variables and the
model is fitted again. Those outliers that turn out to be not significant for the critical
value cval
are discarded/removed. The procedure is iterated until all the outliers are significant
in the final set of outliers.
"bottom-up"
: First the, the outlier with larger
The option "en-masse"
may be preferred to "bottom-up"
when there are are several outliers,
since it may be hard to fit an ARIMA model with many regressor variables.
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
locate.outliers
, tso
.
if (FALSE) {
data("hicp")
y <- log(hicp[["011600"]])
fit <- arima(y, order = c(1, 1, 0), seasonal = list(order = c(2, 0, 2)))
# initial set of outliers
res <- locate.outliers.oloop(y, fit, types = c("AO", "LS", "TC"))
res$outliers
# given the model fitted above, the effect on the data of some of
# the outliers is not significant (method = "en-masse")
discard.outliers(res, y, method = "en-masse",
tsmethod.call = fit$call)$outliers
# in this case, using method = "bottom-up" the first four
# outliers with higher t-statistic are kept
discard.outliers(res, y, method = "bottom-up",
tsmethod.call = fit$call)$outliers
}
Run the code above in your browser using DataLab