Learn R Programming

outliers.ts.oga (version 1.1.2)

db_hom_oga: 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)

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.

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.

Author

Pedro Galeano.

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.

References

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

See Also

single_oga; db_het_oga.

Examples

Run this code
# \donttest{
# Load FRED_MD dataset
data("FRED_MD")

# Define frequency s
s <- 12

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

Run the code above in your browser using DataLab