mmqt_test: Test batches with a Multimodal QuantTree

View source: R/dfr_mmqt.R

mmqt_testR Documentation

Test batches with a Multimodal QuantTree

Description

Assigns each batch to the closest modality of an mmqt() model (Eq. 7) and compares its total variation statistic with the threshold of that modality (Eqs. 8-9).

Usage

mmqt_test(model, batches)

Arguments

model

An mmqt object.

batches

A batch (matrix or data frame) or a list of batches, with the columns of the training set and model$nu rows each.

Value

A data frame with one row per batch: the assigned modality, the statistic, the threshold of the modality and whether a change is detected (drift).

Examples

set.seed(1)
training <- lapply(1:40, function(i) matrix(stats::rnorm(128), ncol = 2))
model <- mmqt(training, bins = 8, n_modalities = 1, n_sim = 2000)
mmqt_test(model, list(matrix(stats::rnorm(128), ncol = 2), matrix(stats::rnorm(128, 1), ncol = 2)))

heimdall documentation built on Dec. 2, 2026, 5:08 p.m.