← Back to all sparks
W

weird

ANALYTICS
Velocity0.0

Functions and Data Sets for "Thats Weird: Anomaly Detection Using R" by Rob J Hyndman

weird rebuilt itself on distributional objects, and now the anomaly tooling composes with everything else.

anomaly-detectionr-packagedistributionalrobust-statisticsdata-visualization
Current state
An R package for anomaly detection and unusual-observation diagnostics, at four releases with a long gap between the 2024 patch and the 2026 major line. The current shape is set by 2.0.0, which refactored the package onto distributional objects and renamed its central concept from density_scores() to surprisals(). Since then the work has been filling that structure in: surprisals for more model classes, faster bandwidth and probability calculations, and new visual diagnostics.
Where it's heading
The refactor onto a shared distribution representation is the decision everything else follows from. It let 2.1.0 add hdr() and parameters() methods for kde objects rather than bespoke accessors, and it let 3.0.0 bring in dist_mclust() to turn a Gaussian mixture model into the same object type — so a mixture, a kernel density estimate and a fitted distribution all flow through one interface. The 3.0.0 additions lean visual and multivariate: outlier maps plotting score distance against orthogonal distance, biplot projections with variable axes overlaid, and an augment() method for robust PCA objects. Dependencies have been shed steadily along the way — lookout, interpolation — while mvscale() moved out and then back in.
Prediction
Expect surprisals() coverage to keep extending to further model classes, and the multivariate and robust-PCA diagnostics introduced in 3.0.0 to gain the same distributional-object treatment as the univariate side.

Recent moves

  1. 1mo ago

    Outlier maps, biplot projections, and Gaussian mixtures as distributional objects

    Adds outlier_map() for plotting score distance against orthogonal distance with cutoffs, biplot_projection() for two-dimensional score projections with variable axes overlaid, and an augment() method for rrcov robust PCA objects. dist_mclust() converts a Gaussian mixture model into a distributional object, extending the shared representation that 2.0.0 established to another model family.

    View source ↗
  2. 3mo ago

    surprisals() reaches glm objects; lookout dependency dropped

    Extends surprisals() and surprisals_prob() to glm objects, speeds up the lm and gam paths, and improves rank-based calculations when ties and missing values are present. The lookout dependency is dropped with mvscale() moved back into the package, and kde_bandwidth() uses mlpack for merge distances. Consolidation of the surface 2.0.0 defined.

    View source ↗
  3. 6mo ago

    Package refactored onto distributional objects; density_scores becomes surprisals

    The structural release: the package is rebuilt around distributional objects, dist_kde() and dist_density() arrive, as_kde() and autoplot.kde() are removed, and density_scores() is replaced by surprisals() with a companion surprisals_prob(). Breaking on several fronts at once, but it is the change that makes every later addition compose rather than accumulate.

    View source ↗
  4. 2y ago

    Wine reviews dataset replaced with a fetch function

    Removes the bundled wine_reviews dataset in favour of fetch_wine_reviews(), plus bug fixes. Package-size housekeeping, and the last release before the two-year gap that preceded the 2.0.0 rebuild.

    View source ↗