db_het_oga {outliers.ts.oga}R Documentation

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

Description

Detects and cleans Additive Outliers (AOs) and Level Shifts (LSs) in time series that form a heterogeneous database, i.e. the series may have different definitions, sample sizes and/or frequencies. The function runs in parallel on the computer cores.

Usage

db_het_oga(Y)

Arguments

Y

The database, a list of p ts objects with possibly different lengths and/or frequencies. It is assumed that each time series has its frequency defined in its ts object.

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 list of ts objects 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 list of p cleaned time series.

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_hom_oga.

Examples


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

# Define frequency s, the same for all series
s <- 12

# Define a list with the first 10 time series with frequency s
X <- FREDMDApril19[,1:10]
Y <- vector(mode='list',length=ncol(X))
for (k in 1:ncol(X)){Y[[k]] <- ts(X[,k],frequency=s)}

# Apply the function to Y
out_db_het_oga <- db_het_oga(Y)


[Package outliers.ts.oga version 0.0.1 Index]