Learn R Programming

Harbinger

Harbinger is a framework for event detection in time series. It provides an integrated environment for anomaly detection, change point detection, and motif discovery. Harbinger offers a broad range of methods and functions for plotting and evaluating detected events.

For anomaly detection, methods are based on: - Machine learning model deviation: Conv1D, ELM, MLP, LSTM, Random Regression Forest, and SVM - Classification models: Decision Tree, KNN, MLP, Naive Bayes, Random Forest, and SVM - Clustering: k-means and DTW - Statistical techniques: ARIMA, FBIAD, GARCH

For change point detection, Harbinger includes: - Linear regression, ARIMA, ETS, and GARCH-based approaches - Classic methods such as AMOC, ChowTest, Binary Segmentation (BinSeg), GFT, and PELT

For motif discovery, it provides: - Methods based on Hashing and Matrix Profile

Harbinger also supports multivariate time series analysis and event evaluation using both traditional and soft computing metrics.

The architecture of Harbinger is based on Experiment Lines and is built on top of the DAL Toolbox. This design makes it easy to extend and integrate new methods into the framework.


Installation

The latest version of Harbinger is available on CRAN:

#install.packages"harbinger")

You can install the development version from GitHub:

library(devtools)
devtools::install_github("cefet-rj-dal/harbinger", force = TRUE, upgrade = "never")

Examples

Examples of Harbinger are organized by application area:

library(harbinger)
#> Registered S3 method overwritten by 'quantmod':
#>   method            from
#>   as.zoo.data.frame zoo
#> Registered S3 methods overwritten by 'forecast':
#>   method  from 
#>   head.ts stats
#>   tail.ts stats

#loading the example database
data(examples_anomalies)

#model
model <- harbinger()

#stub detector
detection <- detect(model, examples_anomalies$simple$serie)

# filtering detected events
library(dplyr)
#> 
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#> 
#>     filter, lag
#> The following objects are masked from 'package:base':
#> 
#>     intersect, setdiff, setequal, union
print(detection |> dplyr::filter(event==TRUE))
#> [1] idx   event type 
#> <0 rows> (or 0-length row.names)

Bug reports and feature requests

If you find any bugs or would like to suggest new features, please submit an issue here:

https://github.com/cefet-rj-dal/harbinger/issues

Copy Link

Version

Install

install.packages('harbinger')

Monthly Downloads

20,003

Version

1.2.727

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Eduardo Ogasawara

Last Published

June 29th, 2025

Functions in harbinger (1.2.727)

hanr_fft_amoc

Anomaly Detector using FFT with AMOC Cutoff
hanr_fft_sma

Anomaly Detector using Adaptive FFT and Moving Average
hanr_fft_amoc_cusum

Anomaly Detector using FFT with AMOC and CUSUM Cutoff
hanr_fft

Anomaly detector using FFT
hanr_fbiad

Anomaly detector using FBIAD
harbinger

Harbinger
har_ensemble

Harbinger Ensemble
hanr_red

Anomaly and change point detector using RED
hmo_xsax

Motif discovery using xsax
hcp_amoc

At most one change (AMOC) method
hanr_ml

Anomaly detector based on machine learning regression.
hanr_fft_binseg

Anomaly Detector using FFT with Binary Segmentation Cutoff
hcp_binseg

Binary segmentation (BinSeg) method
hmu_pca

Multivariate anomaly detector using PCA
hdis_sax

Discord discovery using SAX
hcp_chow

Chow test method
hcp_cf_lr

Change Finder using LR
hdis_mp

Discord discovery using Matrix Profile
harutils

Harbinger Utils
hanr_remd

Anomaly detector using REMD
trans_xsax

XSAX
har_eval

Evaluation of event detection
har_eval_soft

Evaluation of event detection
hcp_garch

Change Finder using GARCH
hcp_gft

Generalized Fluctuation Test (GFT)
hmo_sax

Motif discovery using SAX
hmo_mp

Motif discovery using Matrix Profile
hanr_wavelet

Anomaly detector using Wavelet
hcp_cf_arima

Change Finder using ARIMA
har_plot

Plot event detection on a time series
hcp_pelt

Pruned exact linear time (PELT) method
hcp_scp

Seminal change point
hcp_cf_ets

Change Finder using ETS
mas

Moving average smoothing
trans_sax

SAX
hanct_dtw

Anomaly detector using DTW
detect

Detect events in time series
hanr_garch

Anomaly detector using GARCH
examples_changepoints

Time series for change point detection
hanc_ml

Anomaly detector based on machine learning classification
han_autoencoder

Anomaly detector using autoencoder
hanct_kmeans

Anomaly detector using kmeans
hanr_fft_binseg_cusum

Anomaly Detector using FFT with BinSeg and CUSUM Cutoff
hanr_histogram

Anomaly detector using histogram
examples_anomalies

Time series for anomaly detection
examples_motifs

Time series for change point detection
examples_harbinger

Time series for event detection
hanr_arima

Anomaly detector using ARIMA.
hanr_emd

Anomaly detector using EMD