dot-leverage_limit: Leverage (Mahalanobis) limit for a new observation

.leverage_limitR Documentation

Leverage (Mahalanobis) limit for a new observation

Description

Upper control limit for the ncomp-normalized Mahalanobis leverage produced by .gh_distance, for an observation that was not part of the calibration set. For a model with ncomp components fitted on n calibration samples, the squared Mahalanobis distance of a new observation has upper limit \mjeqn\fracp(n+1)(n-1)n(n-p) F_\alpha; p,\, n-pp(n+1)(n-1)/(n(n-p)) F. Dividing by p = ncomp (the leverage normalization) gives the limit returned here. Unlike an in-sample limit, this grows as ncomp approaches n, reflecting the wider spread expected of new samples.

Usage

.leverage_limit(n, ncomp, conf = 0.95)

Arguments

n

the number of calibration observations.

ncomp

the number of components.

conf

the confidence level of the limit (default 0.95).

Value

A single numeric upper limit, or NA_real_ if it cannot be computed (non-finite inputs, or ncomp not in 1:(n - 1)).

References

De Maesschalck, Roy, Delphine Jouan-Rimbaud, and Désiré L. Massart. "The mahalanobis distance." Chemometrics and intelligent laboratory systems 50.1 (2000): 1-18.


proximetricsR documentation built on Sept. 4, 2026, 5:08 p.m.