fdaspc: Elastic Functional Statistical Process Control

View source: R/fdaspc.R

fdaspcR Documentation

Elastic Functional Statistical Process Control

Description

Fits PCA-based process monitoring models (Hotelling T^2 and SPE/Q charts) to aligned functional data in the SRVF framework, with separate models for amplitude (vertical fPCA, vertFPCA()) and phase (horizontal fPCA, horizFPCA()). The monitoring statistics and control limits follow Ge and Song (2013), Sec. 2.1, Eqs. (2.3)-(2.8), applied to the elastic fPCA features. New functions are monitored with spc_monitor().

Usage

fdaspc(
  warp_data,
  var_exp = 0.95,
  no = NA,
  alpha = 0.01,
  t2limit = c("standard", "book"),
  id = round(length(warp_data$time)/2),
  realign = TRUE
)

Arguments

warp_data

An object of class fdawarp from time_warping() holding the aligned normal-operating-condition data.

var_exp

Cumulative proportion of variance used to choose the number of components: the smallest number whose cumulative proportion reaches var_exp. A scalar, or a vector c(amplitude, phase). Defaults to 0.95.

no

Number of components, a scalar or c(amplitude, phase). Where given (not NA), it overrides var_exp. Defaults to NA.

alpha

Significance level of the control limits. Defaults to 0.01.

t2limit

Formula of the T^2 limit: "standard", k(n^2-1)/(n(n-k)) F, or "book", k(n-1)/(n-k) F. Defaults to "standard".

id

Index of the time point used for f(id) in the amplitude model. Defaults to the midpoint.

realign

A Boolean specifying whether to compute the training T^2/SPE and the limits from the training functions re-aligned to the template with align_new(), the same path spc_monitor() uses. Re-alignment perturbs the SRVFs, so limits fit to the in-sample residuals are too tight for monitored data; FALSE uses the in-sample features. Defaults to TRUE.

Value

An object of class fdaspc, a list with

warp_data

the fdawarp object

vpca

the amplitude model, a vfpca object

hpca

the phase model, an hfpca object

alpha, t2limit

the significance level and T^2 limit formula

amp, ph

the amplitude and phase models: number of components k, number of training functions n, limits T2lim and SPElim, the chi-square scale g and degrees of freedom h of the SPE limit, and the training statistics T2 and SPE

mon

the results of the last spc_monitor() call (NULL until then)

References

Tucker, J. D. (2016). Functional statistical process control using elastic methods. Proceedings of the Joint Statistical Meetings.

Ge, Z., Song, Z. (2013). Multivariate Statistical Process Control. Springer.

Examples

## Not run: 
  warp <- time_warping(simu_data$f, simu_data$time)
  spc <- fdaspc(warp, alpha = 0.05)
  spc <- spc_monitor(spc, 1.5 * simu_data$f[, 1:3])
  spc$mon$alarm
  plot(spc)
  plot_contrib(spc, 1)

## End(Not run)

fdasrvf documentation built on Nov. 21, 2026, 1:09 a.m.