Description Usage Arguments Details Value Examples
Computes control chart values for Nonparametric Multivariate Change Point Model
1 | NPMVCP(X)
|
X |
A matrix containing observed process readings. Each row represents a single realization of a random vector. |
Computes control chart value for nonparametric multivariate change point model.
A data frame containing original data vectors, control chart values (Rmax), and estimated shift location (tauhat).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | library(NPMVCP)
data("Alsmelterdata")
output <- NPMVCP(Alsmelterdata)
# p = dimension of each data vector #
p <- ncol(Alsmelterdata)
# c = degree of quarantine #
c <- 15
# N = total number of observation vectors #
N <- nrow(Alsmelterdata)
# set monitoring start value #
monitoring.start <- max(p + 10, 2*c + 3)
# load control limits #
CLdatastring <- paste("CLp", p, "c", c, sep="")
data(list=CLdatastring)
CL <- get(CLdatastring)[,"0.002"]
# extrapolate control limits beyond n = 500, if necessary #
nmax <- N-(monitoring.start-1)
if (nmax > 500) {
ninv <- 1/(100:500)
CLexmodel <- lm(CL[100:500] ~ ninv)
CL <- c(CL, pmax(CL[500], CLexmodel$coef[1] + CLexmodel$coef[2]*(1/(501:nmax))))
}
# adjust index of control limit vector for plotting #
CLtoplot <- c(rep(NA, monitoring.start-1), CL[1:(N-(monitoring.start-1))])
## Not run: plot(output$Rmax, ylim=c(0, 24), type="b")
## Not run: lines(CLtoplot)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.