timeSeriesSpcAD
Create an anomaly detector that applies statistical process control techniques to time series data
Since R2026a
Description
Add-On Required: This feature requires the Time Series Anomaly Detection for MATLAB add-on.
timeSeriesSpcAD creates an anomaly detector based on
statistical process control (SPC) techniques.
SPC techniques track the values or statistics of a time series over time against mean and
standard deviation limits that bound normal data. The visual tracking mechanism is called a
control chart, which shows both the boundaries and a representative
statistic to track. The control rules determine when a violation
occurs. For example, the control rule "n1" reports a violation if the
statistic is three standard errors from the specified center line
When you use timeSeriesSpcAD, you create a TimeSeriesSPCDetector detector that encapsulates the control chart. As with other
anomaly detectors, you can train the dataset on normal data in order to derive the normal
limits for data. You then use a detection algorithm to identify anomalies based on the control
rules you specify. The detection process flags the anomalous points in plots.
For more detailed information on the statistical process control functions that this
detector is based on, see controlchart and controlrules in Statistics and Machine Learning Toolbox™.
creates a detector = timeSeriesSpcAD(NumChannels)TimeSeriesSPCDetector detector for time series data with
NumChannels input channels.
sets additional options using one or more name-value arguments.detector = timeSeriesSpcAD(NumChannels,Name=Value)
For example, detector = timeSeriesSpcAD(3,WindowLength=20) creates a
creates a TimeSeriesSpcDetector detector with three input channels and a
window size of 20 for batch-means computation.
Examples
Input Arguments
Name-Value Arguments
Output Arguments
References
[1] Nelson, Lloyd S. “The Shewhart Control Chart—Tests for Special Causes.” Journal of Quality Technology 16, no. 4 (1984): 237–39. https://doi.org/10.1080/00224065.1984.11978921.
[2] Alexopoulos, Christos, and Andrew F. Seila. “Implementing the Batch Means Method in Simulation Experiments.” Proceedings of the 28th Conference on Winter Simulation - WSC ’96, ACM Press, 1996, 214–21. https://doi.org/10.1145/256562.256608.
[3] Runger, George C., and Thomas R. Willemain. “Batch-Means Control Charts for Autocorrelated Data.” IIE Transactions 28, no. 6 (1996): 483–87. https://doi.org/10.1080/07408179608966295.
[4] Hunter, J. Stuart. “The Exponentially Weighted Moving Average.” Journal of Quality Technology 18, no. 4 (1986): 203–10. https://doi.org/10.1080/00224065.1986.11979014.
Version History
Introduced in R2026a
See Also
TimeSeriesSPCDetector | train | detect | plot | plotHistogram | updateDetector | controlrules | controlchart


