This function takes in a threshold object returned by the
threshold() function and a single observation as a matrix or xts row.
Internally, the function multiplies the observation by the projection
matrix returned within the threshold object, calculates the SPE and T2
process monitoring statistics for that observation, and compares these
statistics against their corresponding threshold values to determine if the
observation lies outside the expected boundaries. The function then returns
a row vector of the SPE test statistic, a logical indicator marking if this
statistic is beyond the threshold, the Hotelling's T2 statistic, and an
indicator if this statistic is beyond the threshold. Observations with
monitoring statistics beyond the calculated threshold are marked with a 1,
while observations within normal operating conditions are marked with a 0.
These threshold values are passed from the threshold() function through
this function via a returned threshold object. This object will be used in
higher function calls.
This internal function is called by faultFilter().