db_het_oga {outliers.ts.oga} | R Documentation |
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.
db_het_oga(Y)
Y |
The database, a |
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.
n_AOs |
A |
n_LSs |
A |
AOs |
A |
LSs |
A |
Y_clean |
The cleaned database, a |
result |
A message indicating when the procedure has worked correctly or the problem encountered if the procedure stops. |
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.
Pedro Galeano.
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.
# 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)