outliers: Outliers detection at known/unknown dates

outliers.tfmR Documentation

Outliers detection at known/unknown dates

Description

outliers performs a detection of four types of anomalies (AO, TC, LS and IO) in a time series described by an ARIMA model. If the dates of the outliers are unknown, an iterative detection process like that proposed by Chen and Liu (1993) is conducted.

Usage

## S3 method for class 'tfm'
outliers(
  mdl,
  y = NULL,
  types = c("AO", "LS", "TC", "IO"),
  dates = NULL,
  c = 3,
  calendar = FALSE,
  easter = FALSE,
  resid = c("exact", "cond"),
  n.ahead = NULL,
  p.value = 1,
  tc.fix = TRUE,
  envir = NULL,
  ...
)

outliers(mdl, ...)

## S3 method for class 'um'
outliers(
  mdl,
  y = NULL,
  types = c("AO", "LS", "TC", "IO"),
  dates = NULL,
  c = 3,
  calendar = FALSE,
  easter = FALSE,
  resid = c("exact", "cond"),
  n.ahead = 0,
  p.value = 1,
  tc.fix = TRUE,
  envir = NULL,
  ...
)

Arguments

mdl

an object of class um or tfm.

y

an object of class ts, optional.

types

a vector with the initials of the outliers to be detected, c("AO", "LS", "TC", "IO").

dates

a list of dates c(year, season). If dates = NULL, an iterative detection process is conducted.

c

a positive constant to compare the z-ratio of the effect of an observation and decide whether or not it is an outlier. This argument is only used when dates = NULL.

calendar

logical; if true, calendar effects are also estimated.

easter

logical; if true, Easter effect is also estimated.

resid

type of residuals (exact or conditional) used to identify outliers.

n.ahead

a positive integer to extend the sample period of the intervention variables with n.ahead observations, which could be necessary to forecast the output.

p.value

estimates with a p-value greater than p.value are omitted.

tc.fix

a logical value indicating if the AR coefficient in the transfer function of the TC is estimated or fix.

envir

environment in which the function arguments are evaluated. If NULL the calling environment of this function will be used.

...

other arguments.

Value

an object of class "tfm" or a table.

Examples

Y <- rsales
um1 <- um(Y, i = list(1, c(1, 12)), ma = list(1, c(1, 12)), bc = TRUE)
outliers(um1)

tfarima documentation built on May 20, 2022, 5:06 p.m.