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