outliers.variables | R Documentation |
Outliers regressors
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)
frequency |
Annual frequency (divisor of 12). |
start, length |
First date (array with the first year and the first period)
(for instance |
s |
time series used to get the dates for the trading days variables. If supplied the
parameters |
pos, date |
the date of the outlier, defined by the position in period compared to the first date ( |
rate |
the rate of the transitory change regressor (see details). |
zeroended |
boolean indicating if the regressor should end by 0 ( |
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}
#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"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.