Harbinger is a framework for event detection in time series. It offers a unified interface for anomaly detection, change-point detection, motif discovery, transformations, plotting, and evaluation. The package is designed to help users move from exploratory examples to reproducible experiment lines with less friction.
What you can study with Harbinger
- anomaly detection with statistical models, clustering, supervised learning, and deep autoencoders
- change-point detection with classical tests, segmentation methods, and ChangeFinder-based strategies
- motif and discord discovery with symbolic methods and Matrix Profile algorithms
- transformations such as smoothing and symbolic encoding before detection or pattern discovery
- hard and soft evaluation of detected events in univariate and multivariate series
Where to start
The examples are organized so that a new user can understand not only how to run a method, but also why that method is useful and what to look for in the result.
- Tutorials: a numbered guided path from first steps and data understanding to transformations, detection, evaluation, and motifs
- General examples: short guided tours of the package, utilities, and evaluation workflows
- Custom examples: extension-oriented notebooks showing how to plug custom detectors, transformations, and evaluation rules into Harbinger
- Dataset examples: how to load the full benchmark datasets, inspect their structure, and visualize the first available signal
-
Transformation examples: smoothing and symbolic representations such as
mas(),trans_sax(), andtrans_xsax() - Anomaly examples: detectors for isolated, contextual, collective, and multivariate anomalies
- Change-point examples: examples focused on regime shifts, structural breaks, and volatility changes
- Motif examples: repeated-pattern discovery and discord analysis with symbolic and Matrix Profile approaches
A first example
The snippet below uses the default harbinger() pipeline on a bundled dataset. It is intentionally short so that new users can see the core workflow before exploring the more detailed notebooks in /examples/.
library(harbinger)
library(dplyr)
# Load an example dataset with labeled anomalies
data(examples_anomalies)
# Create the default detector and run it on the series
model <- harbinger()
detection <- detect(model, examples_anomalies$simple$serie)
# Inspect only the detected events
print(detection |> dplyr::filter(event == TRUE))Installation
The latest release of Harbinger is available on CRAN:
install.packages("harbinger")To install the development version from GitHub:
Learn the examples progressively
If you are new to the package, this order works well:
- start with
/examples/tutorial/README.mdfor the guided path - continue with
/examples/general/examples_harbinger.mdif you want a compact package tour - visit
/examples/data/README.mdto understand the benchmark datasets and how to load their full versions - visit
/examples/transformations/README.mdto see smoothing and symbolic representations before modeling - move to one family of methods such as anomalies or change points
- visit
/examples/custom/README.mdwhen you want to see how new components can be integrated into the framework - finish with
/examples/motifs/README.mdwhen you want to study repeated patterns and symbolic sequence analysis
Harbinger