mspMonitor: Real-Time Process Monitoring Function

Description Usage Arguments Details Value See Also Examples

View source: R/mspMonitor.R

Description

Monitor and flag (if necessary) incoming multivariate process observations.

Usage

1
mspMonitor(observations, labelVector, trainingSummary, ...)

Arguments

observations

an n x p xts matrix. For real-time monitoring via a script within a batch file, n = 1, so this must be a 1 x p matrix. If lags were included at the training step, then these observations will also have lagged features.

labelVector

an n x 1 integer vector of class memberships

trainingSummary

the TrainingSpecs list returned by the mspTrain() function. This list contains—for each class—the SPE and T2 thresholds, as well the projection matrix.

...

Lazy dots for additional internal arguments

Details

This function is designed to be run at specific time intervals (e.g.every 10 seconds, 30 seconds, 1 minute, 5 minutes, 10 minutes) through a scheduled operating script which calls this function and mspWarning(). We expect this script to be set up in Windows "Task Scheduler" or Macintosh OX "launchd" application suites. This function takes in the specific observations to monitor and their class memberships (if any) and returns an xts matrix of these observation columns concatenated with their monitoring statistic values, flag statuses, and an empty alarm column. Users should then append these rows onto a previously existing matrix of daily observations. The mspWarning() function will then take in the daily observation xts matrix with updated rows returned by this function and check the monitoring statistic flag indicators to see if an alarm status has been reached. For further details, see the mspWarning() function.

This function calls the faultDetect() function, and requires the training information returned by the mspTrain function. This function will return the xts matrix necessary for the mspWarning() function.

Value

An n x (p + 5) xts matrix, where the last five columns are:

See Also

Calls: faultDetect. Pipe flow: mspTrain into mspMonitor into mspWarning.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
## Not run: # cut down on R CMD check time

  nrml <- mspProcessData(faults = "NOC")
  n <- nrow(nrml)

  # Calculate the training summary, but save five observations for monitoring.
  trainResults_ls <- mspTrain(data = nrml[1:(n - 5), -1],
                              labelVector = nrml[1:(n - 5), 1],
                              trainObs = 4320)

  # While training, we included 1 lag (the default), so we will also lag the
  #   observations we will test.
  testObs <- nrml[(n - 6):n, -1]
  testObs <- xts:::lag.xts(testObs, 0:1)
  testObs <- testObs[-1,]
  testObs <- cbind(nrml[(n - 5):n, 1], testObs)

  mspMonitor(observations = testObs[, -1],
             labelVector = testObs[, 1],
             trainingSummary = trainResults_ls$TrainingSpecs)


## End(Not run)

mvMonitoring documentation built on May 2, 2019, 7:22 a.m.