db_hom_oga {outliers.ts.oga}R Documentation

Detecting and cleaning outliers in a homogeneous time series database with OGA

Description

Detects and cleans Additive Outliers (AOs) and Level Shifts (LSs) in time series that form a homogeneous database, i.e. all series are defined similarly, have the same length and the same frequency. The function runs in parallel on the computer cores.

Usage

db_hom_oga(Y,s=NULL)

Arguments

Y

The database, a matrix of size Txp, where T is the time series length and p is the number of series.

s

Optional, the time series frequency, i.e., the number of observations per unit of time (s=1 for non-seasonal, s=4 for quarterly, s=7 for weekly, s=12 for monthly, s=24 for daily, s=52 for yearly, or s=60 for hourly). If the value of s is not given, the value s=1 is taken.

Details

The function applies the single_oga function to each of the time series that make up the database to detect outlier effects and clean the series of such effects. This process is run in parallel on the computer cores, which saves a lot of computational cost. The function provides a matrix with the original series cleaned from the effect of the AOs and LSs, in addition to the location, size and t-statistic corresponding to each of them.

Value

n_AOs

A vector with the number of AOs detected in each series of the database.

n_LSs

A vector with the number of LSs detected in each series of the database.

AOs

A list with the AOs detected in each series of the database.

LSs

A list with the LSs detected in each series of the database.

Y_clean

The cleaned database, a matrix of size Txp.

result

A message indicating when the procedure has worked correctly or the problem encountered if the procedure stops.

Note

The computational cost depends on the size of the database and the level of contamination of the series. Note that the function may take several minutes if the database contains hundred of series with thousands of observations.

Author(s)

Pedro Galeano.

References

Galeano, P., Peña, D. and Tsay, R. S. (2024). Efficient outlier detection in heterogeneous time series databases. Working paper, Universidad Carlos III de Madrid.

See Also

single_oga; db_het_oga.

Examples


# Load FREDMDApril19 dataset from the SLBDD package
data("FREDMDApril19",package="SLBDD")

# Define frequency s
s <- 12

# Apply the procedure to the first 10 time series in FREDMDApril19
Y <- FREDMDApril19[,1:10]
out_db_hom_oga <- db_hom_oga(Y,s=s)


[Package outliers.ts.oga version 0.0.1 Index]