calibrateControlLimit: Calibration of the control limit for the selected chart In SNSchart: Sequential Normal Scores in Statistical Process Management

Description

The methodology used to calibrate the control limit for the SNS chart depending on the selected chart

Usage

 ``` 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``` ```calibrateControlLimit( targetARL = NULL, targetMRL = NULL, n, m, theta = NULL, Ftheta = NULL, scoring = "Z", Chi2corrector = "None", dist, mu, sigma, dist.par = c(0, 1, 1), chart, chart.par, replicates = 50000, isParallel = TRUE, maxIter = 20, progress = TRUE, alignment = "unadjusted", constant = NULL, absolute = FALSE, isFixed = FALSE, rounding.factor = NULL ) ```

Arguments

 `targetARL` scalar. is the target ARL to calibrate. By default is set to NULL `targetMRL` scalar. is the target ARL to calibrate. By default is set to NULL `n` scalar. Subroup size `m` scalar. Reference sample size `theta` scalar. Value corresponig with the `Ftheta` quantile. `Ftheta` scalar. Quantile of the data distribution. The values that take are between (0,1). `scoring` character string. If "Z" (normal scores) (default). If "Z-SQ" (normal scores squared). `Chi2corrector` character string. Only when scoring is Z-SQ. Select from "approx: Z^2*(m + 1 + 1.3)/(m+1). "exact": Z^2/mean(Z). "none": Z^2. If "approx" () (default). If "exact" (normal scores squared). `dist` character string. Select from: "Uniform: Continuous Uniform distribution . "Normal": Normal distribution (default). "Normal2": Squared Normal distribution (also known as Chi-squared). "DoubleExp": Double exponential distribution (also known as Laplace distribution). "DoubleExp2": Double exponential squared distribution from a `DoubleExp(0,1)`. "LogNormal": Lognormal distribution. "Gamma": Gamma distribution. "Weibull": Weibull distribution. "t": Student-t distribution. `mu` vector. Two elements, the first one is the mean of the reference sample and the second one is the mean of the monitoring sample. `sigma` vector. Two elements, the first one is the sd of the reference sample and the second one is the sd of the monitoring sample. `dist.par` vector. Distribution parameters. `c(par.a, par.b)`. Default `c(0,1)`. `chart` character string. Selected type of chart. Three options are available: Shewhart, CUSUM, EWMA `chart.par` vector. The size depends on the selected chart: Shewhart scheme: is `c(k)`, where `k` comes from UCL = mu + kσ, LCL = mu - kσ. CUSUM scheme: is `c(k, h, t)` where `k` is the reference value and `h` is the control limit, and `t` is the type of the chart (1:positive, 2:negative, 3:two sides) EWMA scheme: is `c(lambda, L)`, where `lambda` is the smoothing constant and `L` multiplies standard deviation to get the control limit `replicates` scalar. Number of replicates to get the ARL `isParallel` logical. If `TRUE` the code runs in parallel according to the number of cores in the computer,otherwise the code runs sequentially. Default `TRUE`. `maxIter` scalar. is a numeric. The maximum number of iteration to take the calibration before stops `progress` logical. If `TRUE` it shows the progress in the console. `alignment` character string. Aligment of the data `X` and `Y`. Select from "unadjusted": nothing is sustracte from `X` and `Y` (default). "overallmean": overall mean is sustracted from `X` and `Y`. "overallmedian": overall median is sustracted from `X` and `Y`. "samplemean": mean from corresponding group (`X` and `Y`) is sustracted from its corresponing vector. "samplemedian": median from corresponding group (`X` and `Y`) is sustracted from its corresponing vector. "referencemean": mean from `Y` is subtracted from `X` and `Y`. "referencemedian": median from `Y` is subtracted from `X` and `Y`. "constantvalue": a constant value is subtracted from `X` and `Y`. `constant` scalar. Only used when the `alignment` is selected "constantvalue". Default `NULL`. `absolute` logical. If `TRUE`, the absolute aligned values are obtained. (Default `FALSE`) `isFixed` logical. If `TRUE` the reference sample does not update, otherwise the reference sample is updated whenever the batch is in control. `rounding.factor` scalar. positive value that determine the range between two consecutive rounded values.

Value

Multiple output. Select by `output\$`

• `objective.function`: scalar. The best solution obtained, in terms of the target ARL or MRL

• `par.value`: scalar. Which parameter of the chart reach this best solution

• `iter`: scalar. In which iteration is found the objective function.

• `found`: boolean. Is TRUE if in the `maxIter` is reached the desired +-5

Note

The argument `chart.par` in this function correspond to the initial parameters to start the calibration.

Examples

 ``` 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 35 36 37 38``` ```n <- 2 # subgroup size m <- 30 # reference-sample size dist <- "Normal" # distribution mu <- c(0, 0) # c(reference sample mean, monitoring sample mean) sigma <- c(1, 1) # c(reference sample sd, monitoring sample sd) #### Distribution parameters dist.par <- c(0, 1) # c(location, scale) #### Other Parameters replicates <- 2 targetARL <- 370 isParallel = FALSE #### Control chart parameters chart <- "Shewhart" chart.par <- c(3) shewhart <- calibrateControlLimit( targetARL = targetARL, targetMRL = NULL, n = n, m = m, theta = NULL, Ftheta = NULL, dist = dist, mu = mu, sigma = sigma, dist.par = dist.par, chart.par = chart.par, replicates = replicates, chart = chart, isParallel = isParallel ) chart <- "CUSUM" chart.par <- c(0.5, 2.5, 3) cusum <- calibrateControlLimit( targetARL = targetARL, targetMRL = NULL, n = n, m = m, theta = NULL, Ftheta = NULL, dist = dist, mu = mu, sigma = sigma, dist.par = dist.par, chart.par = chart.par, replicates = replicates, chart = chart, isParallel = isParallel ) chart <- "EWMA" chart.par <- c(0.2, 2.962) ewma <- calibrateControlLimit( targetARL = targetARL, targetMRL = NULL, n = n, m = m, theta = NULL, Ftheta = NULL, dist = dist, mu = mu, sigma = sigma, dist.par = dist.par, chart.par = chart.par, replicates = replicates, chart = chart, isParallel = isParallel ) ```

SNSchart documentation built on April 7, 2021, 9:07 a.m.