Understand the idea
Imagine tracking a bearing's inner AND outer diameter. If you ran two separate control charts, each at the usual 3-sigma limits, you would actually have a HIGHER combined chance of a false alarm than either chart alone suggests: with ten such charts running side by side, the joint false-alarm rate can be ten times what you intended. Worse, the two measurements are normally correlated (bigger parts tend to be bigger all over), and separate charts have no way to notice when that correlation itself breaks down, even if both individual measurements still look fine on their own charts.
The Hotelling T² chart solves both problems by collapsing all your correlated measurements into ONE number per observation: how far that point sits from the typical multivariate center, measured in a way that accounts for the normal spread AND correlation among the variables (a Mahalanobis distance, if you want the name). One chart, one number, one honest false-alarm rate.
When the chart signals, it tells you WHEN something changed, but not automatically WHICH variable is responsible, a genuinely different kind of question. This card gives you a starting hint (the variable with the largest individual deviation at that point), but pinning down the full explanation of a multivariate signal is a more involved analysis.
A Hotelling T-squared chart is a multivariate control chart: it watches several related measurements at once and turns each row into one number based on its Mahalanobis distance from the center, which is why it is sometimes called a Mahalanobis distance chart.
Practitioner explanation
KernelStats computes T2_i = (x_i - x-bar)' S^-1 (x_i - x-bar), the squared Mahalanobis distance of each observation from the sample mean vector, scaled by the sample covariance matrix S. Two limit forms are offered: Phase I (phase='1', the default) uses the exact Beta-based limit (m-1)^2/m * B(1-alpha; p/2, (m-p-1)/2) appropriate when the SAME data used to estimate x-bar and S is also being judged by the chart; Phase II uses the scaled-F limit p(m+1)(m-1)/(m^2-mp) * F(1-alpha; p, m-p) for monitoring NEW observations independent of the reference sample. Using the wrong phase's formula for the situation understates or overstates the true false-alarm rate, so the card states the phase and alpha explicitly in its limit description rather than leaving the convention implicit.
Two of the three technical assumptions are ACTUALLY TESTED on the data, not merely asserted: marginal normality per variable via Shapiro-Wilk (Bonferroni-corrected across the p variables; marginal normality is necessary but not sufficient for joint multivariate normality, so a pass here is reassurance, not proof, and this limitation is stated plainly rather than glossed over), and independence via a lag-1 Ljung-Box test on each variable. Both checks report 'NOT TESTED' rather than a false pass when m < 8, too short a series to judge either reliably. The THIRD assumption, a covariance matrix that stays stable over time, is not testable from a single pass of the data and is reported as a standing limitation rather than something KernelStats claims to check.
The per-signal 'top variable' hint reports whichever variable has the largest standardized deviation at that point: a quick diagnostic starting point, explicitly NOT the full, rigorous MYT (Mason-Young-Tracy) decomposition that would properly attribute a multivariate signal across all correlated variables. T2 detects shifts in the MEAN vector only; a chart of the generalized variance |S| (which KernelStats does not separately provide) would be needed to monitor shifts in the covariance structure itself. As an exactness check, the Phase I T2 values of the m reference points always sum to exactly p(m-1): a useful sanity check on the computation, not a statistical claim.
When to use it
Consider it when
Two or more continuous, correlated quality characteristics need to be monitored TOGETHER (bearing inner and outer diameter, several chemical concentrations from one batch) so that a shift in their correlation structure is caught even when each variable individually stays within its own limits.
Use caution when
A single measurement (there is nothing multivariate to correlate; use I-MR or X-bar charts), variables believed to be essentially uncorrelated with each other (separate univariate charts are simpler and equally valid), or when the covariance matrix is known or suspected to be unstable over time: T2's limits assume a fixed covariance structure, which this function cannot verify from a single dataset.
Formulas and symbols
Hotelling T-squared statistic
The squared Mahalanobis distance of observation i from the sample mean vector, scaled by the inverse sample covariance matrix S.
Phase I (retrospective) upper control limit
m reference observations, p variables; used when the same data being charted was also used to estimate the mean vector and covariance matrix.
Phase II (monitoring) upper control limit
Used for new observations independent of the m reference points used to estimate the mean vector and covariance matrix.
Assumptions and checks
- Normality (of residuals, not of the raw data). Hotelling's T-squared limits are derived assuming the variables jointly follow a multivariate normal distribution; non-normal marginals (and, more broadly, non-normal joint structure this check cannot fully see) distort the true false-alarm rate of the chart.
In KernelStats: Shapiro-Wilk on each variable's marginal distribution, Bonferroni-adjusted across variables and reported as the worst (smallest-p) variable on the card; this is necessary for joint multivariate normality but not sufficient for it, and is reported as not testable on a short series or a zero-variance variable.
- Independence of observations. T-squared's control limits assume the observations are independent over time; autocorrelation narrows or widens the true spread of T-squared away from its nominal distribution, manufacturing false alarms or masking real ones.
In KernelStats: Ljung-Box lag-1 test on each variable, Bonferroni-adjusted across variables and reported as the worst (smallest-p) variable on the card; reported as not testable on a short series or a zero-variance variable.
Alternatives
- I-MR Chart (Individuals & Moving Range). Only one measurement needs monitoring, or several measurements are genuinely uncorrelated and can be tracked independently without inflating the joint false-alarm rate meaningfully.
- Principal Component Analysis. You have many correlated variables and want to understand and reduce their dimensionality for exploration, rather than build a real-time monitoring chart.
Worked example
Scenario
Three correlated dimensional measurements on 40 manufactured parts (Phase I, alpha = 0.0027), with an injected out-of-control shift at part 30.
Result
Phase I UCL = 12.2303; the T2 value at part 30 is 28.84, well above the limit, with 'diameter B' flagged as the largest individual contributor to that signal.
Interpretation
Part 30 shows a genuine joint departure from the multivariate norm that a well-tuned set of separate univariate charts might have missed if it manifested mainly as a correlation break rather than a large shift in any single measurement; diameter B is the most promising variable to investigate first, though a full attribution analysis would confirm it.
Common misconceptions
Misconception
A Hotelling T² signal tells you exactly which variable caused the problem.
Correction
T² tells you WHEN something changed in the joint distribution of your variables, not automatically WHICH one. The 'top variable' hint on the card (the largest individual standardized deviation) is a useful starting point, not the rigorous answer: a full MYT decomposition is the proper way to attribute a multivariate signal, and this card does not compute it.
Misconception
Running p separate univariate control charts at the usual 3-sigma limits gives the same overall false-alarm protection as one multivariate T² chart.
Correction
Running p independent 3-sigma charts inflates the JOINT false-alarm rate well above the nominal per-chart rate: with 10 charts, the combined false-alarm probability can be roughly ten times the intended 0.27%. It also cannot detect a shift that breaks the CORRELATION between variables while each one individually stays inside its own limits, which is exactly the pattern the T² statistic is built to catch.
References
- Introduction to Statistical Quality Control, Montgomery, D. C. (2019), §11.3.2.
- Multivariate control charts for individual observations, Tracy, N. D., Young, J. C. and Mason, R. L. (1992), Journal of Quality Technology, 24(2), 88-95.
