Learn R Programming

tfarima (version 0.4.1)

outliers.ssm: 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 ssm
outliers(
  mdl,
  types = c("AO", "LS", "TC"),
  dates = NULL,
  c = 3,
  calendar = FALSE,
  easter = FALSE,
  resid = c("exact", "cond"),
  n.ahead = 0,
  p.value = 1,
  ...
)

# S3 method for 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 = 0, p.value = 1, tc.fix = TRUE, envir = parent.frame(), ... )

# S3 method for ucarima outliers( mdl, types = c("AO", "LS", "TC"), dates = NULL, c = 3, calendar = FALSE, easter = FALSE, resid = c("exact", "cond"), n.ahead = 0, p.value = 1, ... )

outliers(mdl, ...)

# S3 method for 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, ... )

Value

an object of class "tfm" or a table.

Arguments

mdl

an object of class um or tfm.

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.

...

other arguments.

y

an object of class ts, optional.

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.

Examples

Run this code
data(rsales)
um1 <- um(rsales, i = list(1, c(1, 12)), ma = list(1, c(1, 12)), bc = TRUE)
outliers(um1)

Run the code above in your browser using DataLab