Learn R Programming

spc4sts (version 0.2.1)

climit: Control Limit and Diagnostic Threshold Construction

Description

Establish control limits and diagnostic thresholds from given Phase I in-control images. climit is used for the first time. climit2 can recompute the control limits and diagnostic thresholds given the output of climit. See Warning.

Usage

climit(imgs, model, stat = c("ad", "bp"), w, grate = c(0.05, 0.0027), nD = c(5, 100))
climit2(cl, grate, nD)

Arguments

imgs

a 3-dimensional array containing all Phase I in-control images.

model

the returned object from surfacemodel

stat

the statistic used in the SMS. Must be either "ad" (default) or "bp".

w

the window size of the SMS. Must be an odd number >= 3.

grate

the global false alarm rate, which asserts the rate of in-control images that are falsely alarmed as out-of-control. This can be a vector, in which case several levels of the control limit are returned.

nD

the parameter to construct the diagnostic threshold. It is the average number of pixels in each diagnostic image that are beyond the control limit.

cl

the returned object from climit.

Value

A list of the following:

nDmaxSms

a vector that stores the (nD*N + 1) largest SMS values computed for all N Phase I images.

PIstats

a vector that stores all the monitoring statistics of the Phase images.

diagnostic.threshold

a scalar/vector that stores the established diagnostic threshold(s).

stat

the argument stat

w

the argument w

control.limit

a scalar/vector that stores the established control limit(s).

Warning

It is better to set the maximum value of nD large enough. climit will only keep the information (for climit2) to establish the diagnostic threshold up to this value.

References

Bui, A.T., and Apley., D.W. (2017) A Monitoring and Diagnostic Approach for Stochastic Textured Surfaces", Technometrics (in press).

See Also

localStat, diagnoseLD

Examples

Run this code
# NOT RUN {
## build the in-control model
img <- sarGen(m = 100, n = 100, border = 50) # training image
model <- surfacemodel(img,1)

## generate Phase I images
imgs <- array(0, c(100,100,1))
for (j in 1:dim(imgs)[3]) imgs[,,j] <- sarGen(m = 100, n = 100, border = 50)

## establish control limits and diagnostic thresholds
# construct control limits and diagnostic thresholds for the first time
cl <- climit(imgs, model, stat = "ad", w = 5, grate = .05, nD = 50)
# update new control limit and diagnostic threshold
cl2 <- climit2(cl, grate = .01, nD = 5)

#
# NOTE: The above example is just for quick illustration. To obtain a good
# control limit, the training image should be representative (e.g., set
# m = 250, n = 250, and border = 200). The number of Phase I images also
# needs to be large (e.g., 100 images or more).
#
# For real images in a textile application, use the data package "textile".
#

# }

Run the code above in your browser using DataLab