outliers.variables: Outliers regressors

outliers.variablesR Documentation

Outliers regressors

Description

Outliers regressors

Usage

ao.variable(frequency, start, length, s, pos, date = NULL)

tc.variable(frequency, start, length, s, pos, date = NULL, rate = 0.7)

ls.variable(frequency, start, length, s, pos, date = NULL, zeroended = TRUE)

so.variable(frequency, start, length, s, pos, date = NULL, zeroended = TRUE)

Arguments

frequency

Annual frequency (divisor of 12).

start, length

First date (array with the first year and the first period) (for instance c(1980, 1)) and number of periods of the output variables. Can also be provided with the s argument

s

time series used to get the dates for the trading days variables. If supplied the parameters frequency, start and length are ignored.

pos, date

the date of the outlier, defined by the position in period compared to the first date (pos parameter) or by a specific date defined in the format "YYYY-MM-DD".

rate

the rate of the transitory change regressor (see details).

zeroended

boolean indicating if the regressor should end by 0 (zeroended = TRUE, default) or 1 (zeroended = FALSE).

Details

An additive outlier (AO, ao.variable) is defined as:

AO_t = \begin{cases}1 &\text{if } t=t_0 \newline 0 & \text{if }t\ne t_0\end{cases}

A level shift (LS, ls.variable) is defined as (if zeroended = FALSE):

LS_t = \begin{cases}-1 &\text{if } t < t_0 \newline 0 & \text{if }t≥q t_0 \end{cases}

A transitory change (TC, tc.variable) is defined as:

TC_t = \begin{cases} 0 &\text{if }t < t_0 \newline α^{t-t_0} & t≥q t_0 \end{cases}

A seasonal outlier (SO, so.variable) is defined as (if zeroended = FALSE):

SO_t = \begin{cases} 0 &\text{if }t≥q t_0 \newline -1 & \text{if }t < t_0 \text{ and $t$ same periode as }t_0\newline -\frac{1}{s-1} & \text{otherwise }\end{cases}

Examples

#Outliers in February 2002
ao <- ao.variable(12, c(2000,1), length = 12*4, date = "2002-02-01")
ls <- ls.variable(12, c(2000,1), length = 12*4, date = "2002-02-01")
tc <- tc.variable(12, c(2000,1), length = 12*4, date = "2002-02-01")
so <- so.variable(12, c(2000,1), length = 12*4, date = "2002-02-01")
plot.ts(ts.union(ao, ls, tc, so), plot.type = "single",
        col = c("black", "orange", "green", "gray"))

palatej/rjd3modelling documentation built on Jan. 3, 2023, 10:19 p.m.