classify: Place New Functions in Boxplot Regions

View source: R/boxplot-classify.R

classifyR Documentation

Place New Functions in Boxplot Regions

Description

Aligns new functions to the template of the fit behind an amplitude or phase boxplot (see align_new()) and compares their distance to the median with the boxplot regions: the 50% central region, the (1-\alpha) central region, within the whiskers, or outlier.

Usage

classify(x, ...)

## S3 method for class 'ampbox'
classify(x, f_new, ...)

## S3 method for class 'phbox'
classify(x, f_new, ...)

Arguments

x

An object of class ampbox or phbox typically produced by boxplot.fdawarp() with what = "stats".

...

Unused here.

f_new

A numeric matrix of shape M \times K of K new functions sampled at the time grid of the fit, or a numeric vector of length M for a single function.

Details

For an ampbox, the distance is the amplitude (SRVF) distance of the aligned function to the median SRVF; for a phbox, it is the phase distance of its warping function to the median warping function.

Value

A list with components (one entry or column per function):

  • dist: distance to the median;

  • level: 1 = 50% central region, 2 = (1-\alpha) central region, 3 = within whiskers, 4 = outlier;

  • region: level as text;

  • side: "Q1" or "Q3", the quartile direction the function lies in;

  • fn, qn, gam: the aligned functions, SRVFs and warping functions.

Examples

## Not run: 
out <- time_warping(simu_data$f, simu_data$time, centroid_type = "median")
amp <- boxplot(out, variability_type = "amplitude", what = "stats")
classify(amp, simu_data$f[, 1:3])

## End(Not run)

fdasrvf documentation built on Oct. 29, 2026, 9:06 a.m.