| Title: | Risk-Based Control Charts |
|---|---|
| Description: | Implements univariate and multivariate risk-based control charts for statistical process control in the presence of measurement uncertainty. Available charts include Shewhart X-bar, R, and S charts, moving-average charts, exponentially weighted moving-average charts, cumulative-sum charts, and Hotelling T-squared charts. Chart parameters can be optimized by minimizing the total cost of the four decision outcomes. The methodology is described by Kosztyan and Katona (2016) <doi:10.1016/j.eswa.2016.06.019>, Kosztyan and Katona (2018) <doi:10.1016/j.cie.2018.04.052>, Katona et al. (2023) <doi:10.1109/ACCESS.2023.3312226>, Saghir et al. (2025) <doi:10.1016/j.rineng.2025.107278>, and Saghir et al. (2026) <doi:10.1016/j.rico.2026.100661>. |
| Authors: | Aamir Saghir [aut], Attila Imre Katona [aut], Zsolt Tibor Kosztyan [aut, cre] |
| Maintainer: | Zsolt Tibor Kosztyan <[email protected]> |
| License: | GPL (>= 2) |
| Version: | 0.2.0 |
| Built: | 2026-09-28 12:50:07 UTC |
| Source: | https://github.com/kzst/rbcc |
Tools for risk-based statistical process control in the presence of measurement uncertainty. The package evaluates four decision outcomes and optimizes chart parameters by minimizing total decision cost.
Available charts include X-bar, R, S, moving-average, EWMA, CUSUM, and
multivariate T-squared charts. See citation("rbcc") for references.
Aamir Saghir, Attila Imre Katona, and Zsolt Tibor Kosztyan.
Generate Data from the Pearson Distribution System
data_gen( obs, mu, va, sk, ku, seed = NULL, engine = c("auto", "pearson"), validate = TRUE )data_gen( obs, mu, va, sk, ku, seed = NULL, engine = c("auto", "pearson"), validate = TRUE )
obs |
Positive number of observations per variable. |
mu |
Numeric vector of means. |
va |
Numeric vector of variances. |
sk |
Numeric vector of skewness coefficients. |
ku |
Numeric vector of kurtosis coefficients. |
seed |
Optional integer seed. The caller's random-number state is restored after generation. |
engine |
Either |
validate |
Logical; validate inputs. |
A numeric matrix with one column per variable.
Plot Risk-Based Control Charts
## S3 method for class 'rbcc' plot(x, title = NULL, xlab = "Group", ylab = "Chart statistic", ...) ## S3 method for class 'rbcusumcc' plot(x, title = NULL, xlab = "Group", ylab = "Cumulative sum", ...) ## S3 method for class 'rbmcc' plot(x, title = NULL, xlab = "Group", ylab = "T-squared statistic", ...)## S3 method for class 'rbcc' plot(x, title = NULL, xlab = "Group", ylab = "Chart statistic", ...) ## S3 method for class 'rbcusumcc' plot(x, title = NULL, xlab = "Group", ylab = "Cumulative sum", ...) ## S3 method for class 'rbmcc' plot(x, title = NULL, xlab = "Group", ylab = "T-squared statistic", ...)
x |
A fitted risk-based chart object. |
title |
Optional title. |
xlab, ylab
|
Axis labels. |
... |
Reserved for future use. |
A visible ggplot object.
Print Risk-Based Control-Chart Objects
## S3 method for class 'rbcc' print(x, digits = getOption("digits"), ...) ## S3 method for class 'rbcusumcc' print(x, digits = getOption("digits"), ...) ## S3 method for class 'rbmcc' print(x, digits = getOption("digits"), ...) ## S3 method for class 'summary.rbcc' print(x, digits = getOption("digits"), ...) ## S3 method for class 'summary.rbcusumcc' print(x, digits = getOption("digits"), ...) ## S3 method for class 'summary.rbmcc' print(x, digits = getOption("digits"), ...)## S3 method for class 'rbcc' print(x, digits = getOption("digits"), ...) ## S3 method for class 'rbcusumcc' print(x, digits = getOption("digits"), ...) ## S3 method for class 'rbmcc' print(x, digits = getOption("digits"), ...) ## S3 method for class 'summary.rbcc' print(x, digits = getOption("digits"), ...) ## S3 method for class 'summary.rbcusumcc' print(x, digits = getOption("digits"), ...) ## S3 method for class 'summary.rbmcc' print(x, digits = getOption("digits"), ...)
x |
A fitted or summarized chart object. |
digits |
Number of significant digits. |
... |
Additional print arguments. |
The input object, invisibly.
Risk-Based Shewhart Control Chart
rbcc( X, UC, C, n, type = c("xbar", "R", "S"), confidence_level = 0.9973, K = 3, validate = TRUE )rbcc( X, UC, C, n, type = c("xbar", "R", "S"), confidence_level = 0.9973, K = 3, validate = TRUE )
X |
Numeric process observations. |
UC |
Numeric additive measurement errors. |
C |
Four decision costs ordered as |
n |
Subgroup size. Defaults to one when omitted. |
type |
Chart type: |
confidence_level |
Traditional-chart confidence level. |
K |
Nonnegative risk-based limit coefficient. |
validate |
Logical; validate inputs. |
An object of class rbcc.
Construct Optimization Controls
rbcc_control(grid_size = 201L, tol = .Machine$double.eps^0.25)rbcc_control(grid_size = 201L, tol = .Machine$double.eps^0.25)
grid_size |
Number of points used by the grid optimizer. |
tol |
Positive numerical tolerance. |
A list suitable for the control argument.
Optimize a Risk-Based Shewhart Control Chart
rbcc_opt( X, UC, C, n, type = c("xbar", "R", "S"), confidence_level = 0.9973, K_init = 0, LKL = 0, UKL = 5, optimizer = c("exact", "optimize", "grid"), parallel = FALSE, workers = NULL, control = list(), validate = TRUE )rbcc_opt( X, UC, C, n, type = c("xbar", "R", "S"), confidence_level = 0.9973, K_init = 0, LKL = 0, UKL = 5, optimizer = c("exact", "optimize", "grid"), parallel = FALSE, workers = NULL, control = list(), validate = TRUE )
X |
Numeric process observations. |
UC |
Numeric additive measurement errors. |
C |
Four decision costs ordered as |
n |
Subgroup size. Defaults to one when omitted. |
type |
Chart type: |
confidence_level |
Traditional-chart confidence level. |
K_init |
Initial or tie-breaking coefficient. |
LKL, UKL
|
Lower and upper search bounds. |
optimizer |
One of |
parallel |
Logical; parallelize the grid optimizer. |
workers |
Optional worker count. |
control |
A list created by |
validate |
Logical; validate inputs. |
An optimized rbcc object.
Risk-Based CUSUM Control Chart
rbcusumcc(X, UC, C, n = 1, T = 5, se.shift = 1, K = 5, validate = TRUE)rbcusumcc(X, UC, C, n = 1, T = 5, se.shift = 1, K = 5, validate = TRUE)
X |
Numeric process observations. |
UC |
Numeric additive measurement errors. |
C |
Four decision costs ordered as |
n |
Subgroup size. Defaults to one when omitted. |
T |
Positive traditional decision-interval coefficient. |
se.shift |
Positive standardized reference shift. |
K |
Nonnegative risk-based limit coefficient. |
validate |
Logical; validate inputs. |
Optimize a Risk-Based CUSUM Control Chart
rbcusumcc_opt( X, UC, C, n = 1, T = 5, se.shift = 1, K_init = 0, LKL = 0, UKL = 6, optimizer = c("exact", "optimize", "grid"), parallel = FALSE, workers = NULL, control = list(), validate = TRUE )rbcusumcc_opt( X, UC, C, n = 1, T = 5, se.shift = 1, K_init = 0, LKL = 0, UKL = 6, optimizer = c("exact", "optimize", "grid"), parallel = FALSE, workers = NULL, control = list(), validate = TRUE )
X |
Numeric process observations. |
UC |
Numeric additive measurement errors. |
C |
Four decision costs ordered as |
n |
Subgroup size. Defaults to one when omitted. |
T |
Positive traditional decision-interval coefficient. |
se.shift |
Positive standardized reference shift. |
K_init |
Initial or tie-breaking coefficient. |
LKL, UKL
|
Lower and upper search bounds. |
optimizer |
One of |
parallel |
Logical; parallelize the grid optimizer. |
workers |
Optional worker count. |
control |
A list created by |
validate |
Logical; validate inputs. |
Risk-Based EWMA Control Chart
rbewmacc( X, UC, C, n = 1, lambada = 0.2, nsigmas = 3, K = 3, lambda = NULL, validate = TRUE )rbewmacc( X, UC, C, n = 1, lambada = 0.2, nsigmas = 3, K = 3, lambda = NULL, validate = TRUE )
X |
Numeric process observations. |
UC |
Numeric additive measurement errors. |
C |
Four decision costs ordered as |
n |
Subgroup size. Defaults to one when omitted. |
lambada |
EWMA smoothing parameter; retained for compatibility. |
nsigmas |
Traditional EWMA limit coefficient. |
K |
Nonnegative risk-based limit coefficient. |
lambda |
Correctly spelled alias for |
validate |
Logical; validate inputs. |
Optimize a Risk-Based EWMA Control Chart
rbewmacc_opt( X, UC, C, n = 1, lambada = 0.2, nsigmas = 3, K_init = 0, LKL = 0, UKL = 5, lambda = NULL, optimizer = c("exact", "optimize", "grid"), parallel = FALSE, workers = NULL, control = list(), validate = TRUE )rbewmacc_opt( X, UC, C, n = 1, lambada = 0.2, nsigmas = 3, K_init = 0, LKL = 0, UKL = 5, lambda = NULL, optimizer = c("exact", "optimize", "grid"), parallel = FALSE, workers = NULL, control = list(), validate = TRUE )
X |
Numeric process observations. |
UC |
Numeric additive measurement errors. |
C |
Four decision costs ordered as |
n |
Subgroup size. Defaults to one when omitted. |
lambada |
EWMA smoothing parameter; retained for compatibility. |
nsigmas |
Traditional EWMA limit coefficient. |
K_init |
Initial or tie-breaking coefficient. |
LKL, UKL
|
Lower and upper search bounds. |
lambda |
Correctly spelled alias for |
optimizer |
One of |
parallel |
Logical; parallelize the grid optimizer. |
workers |
Optional worker count. |
control |
A list created by |
validate |
Logical; validate inputs. |
Risk-Based Moving-Average Control Chart
rbmacc(X, UC, C, n = 1, w = 2, K = 3, validate = TRUE)rbmacc(X, UC, C, n = 1, w = 2, K = 3, validate = TRUE)
X |
Numeric process observations. |
UC |
Numeric additive measurement errors. |
C |
Four decision costs ordered as |
n |
Subgroup size. Defaults to one when omitted. |
w |
Positive moving-average span. |
K |
Nonnegative risk-based limit coefficient. |
validate |
Logical; validate inputs. |
Optimize a Risk-Based Moving-Average Control Chart
rbmacc_opt( X, UC, C, n = 1, w = 2, K_init = 0, LKL = 0, UKL = 5, optimizer = c("exact", "optimize", "grid"), parallel = FALSE, workers = NULL, control = list(), validate = TRUE )rbmacc_opt( X, UC, C, n = 1, w = 2, K_init = 0, LKL = 0, UKL = 5, optimizer = c("exact", "optimize", "grid"), parallel = FALSE, workers = NULL, control = list(), validate = TRUE )
X |
Numeric process observations. |
UC |
Numeric additive measurement errors. |
C |
Four decision costs ordered as |
n |
Subgroup size. Defaults to one when omitted. |
w |
Positive moving-average span. |
K_init |
Initial or tie-breaking coefficient. |
LKL, UKL
|
Lower and upper search bounds. |
optimizer |
One of |
parallel |
Logical; parallelize the grid optimizer. |
workers |
Optional worker count. |
control |
A list created by |
validate |
Logical; validate inputs. |
Constructs a risk-based Hotelling T-squared control chart in the presence of additive measurement uncertainty.
rbmcc( X, UC, C, n = 1, confidence_level = 0.99, K = 0, validate = TRUE )rbmcc( X, UC, C, n = 1, confidence_level = 0.99, K = 0, validate = TRUE )
X |
Numeric matrix of true process characteristics. |
UC |
Numeric matrix of additive measurement errors. |
C |
Four decision costs ordered as |
n |
Subgroup size. |
confidence_level |
Traditional-chart confidence level. |
K |
Correction subtracted from the traditional upper control limit. |
validate |
Logical; validate inputs. |
An object of class rbmcc.
Kosztyan, Z. T. and Katona, A. I. (2016). Risk-Based Multivariate Control Chart. Expert Systems with Applications, 62, 250–262. doi:10.1016/j.eswa.2016.06.019
data("t2uc") X <- as.matrix(t2uc[, 1:2]) UC <- as.matrix(t2uc[, 5:6]) C <- c(1, 20, 160, 5) fit <- rbmcc(X, UC, C) fit$cost0data("t2uc") X <- as.matrix(t2uc[, 1:2]) UC <- as.matrix(t2uc[, 5:6]) C <- c(1, 20, 160, 5) fit <- rbmcc(X, UC, C) fit$cost0
Optimize a Risk-Based Multivariate T-Squared Control Chart
rbmcc_opt( X, UC, C, n = 1, confidence_level = 0.99, K_init = 0, LKL = -5, UKL = 5, optimizer = c("exact", "optimize", "grid"), parallel = FALSE, workers = NULL, control = list(), validate = TRUE )rbmcc_opt( X, UC, C, n = 1, confidence_level = 0.99, K_init = 0, LKL = -5, UKL = 5, optimizer = c("exact", "optimize", "grid"), parallel = FALSE, workers = NULL, control = list(), validate = TRUE )
X |
Numeric matrix of true process characteristics. |
UC |
Numeric matrix of additive measurement errors. |
C |
Four decision costs ordered as |
n |
Subgroup size. |
confidence_level |
Traditional-chart confidence level. |
K_init |
Initial or tie-breaking correction. |
LKL, UKL
|
Lower and upper correction bounds. |
optimizer |
One of |
parallel |
Logical; parallelize the grid optimizer. |
workers |
Optional worker count. |
control |
A list created by |
validate |
Logical; validate inputs. |
An optimized rbmcc object.
Summarize Risk-Based Control-Chart Objects
## S3 method for class 'rbcc' summary(object, ...) ## S3 method for class 'rbcusumcc' summary(object, ...) ## S3 method for class 'rbmcc' summary(object, ...)## S3 method for class 'rbcc' summary(object, ...) ## S3 method for class 'rbcusumcc' summary(object, ...) ## S3 method for class 'rbmcc' summary(object, ...)
object |
A fitted risk-based chart object. |
... |
Reserved for future use. |
A structured summary object retaining all original components.
Measurements of two brake-cylinder characteristics obtained with a high-precision optical system and production measurement devices. Measurement errors are the differences between production and optical measurements.
data("t2uc")data("t2uc")
A data frame with 50 observations and six numeric variables:
Optical cutting-length measurement in millimeters.
Optical main-diameter measurement in millimeters.
Manual cutting-length measurement in millimeters.
Manual main-diameter measurement in millimeters.
Manual minus optical cutting-length measurement.
Manual minus optical main-diameter measurement.
Automotive-industry measurement study.
Katona, A. I. (2021). Validation of Risk-Based Quality Control Techniques: A Case Study from the Automotive Industry. Journal of Applied Statistics.
data("t2uc") X <- as.matrix(t2uc[, 1:2]) UC <- as.matrix(t2uc[, 5:6]) fit <- rbmcc_opt(X, UC, c(1, 20, 160, 5)) fit$cost0data("t2uc") X <- as.matrix(t2uc[, 1:2]) UC <- as.matrix(t2uc[, 5:6]) fit <- rbmcc_opt(X, UC, c(1, 20, 160, 5)) fit$cost0