メインコンテンツ

updateDetector

Update settings of a trained statistical process control anomaly detector

Since R2026a

Description

Add-On Required: This feature requires the Time Series Anomaly Detection for MATLAB add-on.

detector = updateDetector(detector,data,Name=Value) updates the properties in the TimeSeriesSPCDetector detector using the name-value arguments that you specify. These arguments represent derived values that you can modify to tune the detector.

Input Arguments

collapse all

Anomaly detector model, specified as a TimeSeriesSPCDetector object.

Time series data to be used for updating the threshold, specified as a matrix, a cell array, or a timetable. data must consist of only normal data, with no known anomalies or anomalous data.

When data contains m sets of signals, each of which contain n = detector.NumChannels channels, the possible formats are these:

  • n-column matrix that consists of a single multichannel signal (m=1).

  • Cell array with m cells that each contain a matrix that has NumChannels columns.

  • Timetable that contains a single multichannel signal , arranged in one of two possible ways.

    • The n channels are distributed in the columns of a matrix that the timetable contains in a single variable

    • The n channels are represented by n timetable variables that each contain a vector.

    In either case, the timetable must contain finite, increasing, and uniformly sampled time values.

Name-Value Arguments

expand all

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Example: detector = updateDetector(detector,dataDectionRules="we1") changes the rule for detection anomalies to the Western Electric rule "we1".

Training-Derived Values

expand all

Vector of estimated sample means of the window (batch) means, represented after training as a numeric vector with one value for each channel. CenterLine provides the basis from which time series deviations are measured during detection.

Estimated sample standard error of the window (batch) means, represented after training as a numeric vector with one value for each channel.

Estimated sample mean of the window (batch) means, represented after training as a numeric vector with one value for each channel. Without custom modifications, Mean is generally equal to CenterLine

Estimated sample standard deviation of the window (batch) means, represented after training as a numeric vector with one value for each channel.

Detection Control

expand all

Number of standard errors around the center line, or mean, of the batch-means data, represented as a numeric scalar.

Detection rules, represented as a string vector. Values containing "we" are Western Electric rules, and values containing "n" are Nelson rules.

ValueViolation Condition
"n"All Nelson rules
"we"All Western Electric rules
"n1"

One point below cl 3*se or above cl + 3*se

"n2"Nine of nine points on the same side of cl
"n3"Six of six points increasing or decreasing
"n4"Fourteen points alternating up or down
"n5"

Two of three points below cl 2*se or above cl + 2*se, all on the same side

"n6"

Four of five points below cl se or above cl + se, all on the same side

"n7"

Fifteen of fifteen points between cl se and cl + se

"n8"

Eight of eight points below cl se or above cl + se, on either side

"we1"

One point above cl + 3*se

  
"we3"

Four of five points above cl + se

"we4"Eight of eight points above cl
"we5"

One point below cl 3*se

"we6"

Two of three points below cl 2*se

"we7"

Four of five points below cl se

"we8"Eight of eight points below cl
"we9"

Fifteen of fifteen points between cl se and cl + se

"we10"

Eight of eight points below cl se or above cl + se

For the control rules that involve more than a single point:

  • A rule violation at point i indicates that the set of consecutive points ending at point i triggers the rule. R(i) is true only if point i is one of the points that violates the rule's condition.

  • Any point whose X, cl, or se value is NaN is not counted and always has an R value of false (logical 0).

Version History

Introduced in R2026a