| Title: | Generalized Process Capability Indices for Interval-Censored Data |
|---|---|
| Description: | A comprehensive framework for computing, estimating, and validating Generalized Process Capability Indices (GPCIs) under interval-censored data. Supports user-supplied probability density functions (PDF/PMF), cumulative distribution functions (CDF), and survival functions (SF). Parameter estimation is performed using Maximum Likelihood Estimation for interval-censored data via the MleCensoR package. Computes classical and generalized capability indices including Cpy (Maiti et al., 2010), Spmk (Dey & Saha, 2019), CpTk (Saha et al., 2019), Cpc (Saha et al., 2022), CNpmc (Alotaibi et al., 2022), CNpmkc (Saha et al., 2024), CNpk (Saha et al., 2018), and Vannman's Cp(u,v) family. Provides parametric and non-parametric bootstrap confidence intervals at 90%, 95%, and 99% confidence levels using percentile, normal, basic, BCa, BCp, and studentized bootstrap methods. Computes standard errors, mean squared errors, and coverage probabilities for both distribution parameters and capability indices. References: Maiti, Saha & Nanda (2010) <doi:10.1080/16843703.2010.11673233>, Saha, Dey & Maiti (2018) <doi:10.1080/21681015.2018.1437793>, Dey & Saha (2019) <doi:10.1007/s41872-019-00081-4>, Saha, Dey & Maiti (2019) <doi:10.1007/s13198-019-00789-7>, Alotaibi, Dey & Saha (2022) <doi:10.1155/2022/3135264>, Saha, Dey & Nadarajah (2022) <doi:10.1080/02664763.2021.1971632>, Saha, Tripathi & Dey (2024) <doi:10.1142/S021853932450013X>. |
| Authors: | Shikhar Tyagi [aut, cre] (ORCID: <https://orcid.org/0000-0003-1606-0844>), Sumit Kumar [aut], Arvind Pandey [aut], Bhupendra Singh [aut], Vrijesh Tripathi [aut] |
| Maintainer: | Shikhar Tyagi <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.1.0 |
| Built: | 2026-10-08 10:14:51 UTC |
| Source: | https://github.com/cran/gpciIntCensor |
Autoplot Generic and Methods for Compatibility
autoplot(object, ...) ## S3 method for class 'gpcifit_censor' autoplot(object, ...) ## S3 method for class 'gpci_ci_censor' autoplot(object, ...) ## S3 method for class 'gpci_diagnostics_censor' autoplot(object, ...)autoplot(object, ...) ## S3 method for class 'gpcifit_censor' autoplot(object, ...) ## S3 method for class 'gpci_ci_censor' autoplot(object, ...) ## S3 method for class 'gpci_diagnostics_censor' autoplot(object, ...)
object |
Object to plot. |
... |
Additional arguments. |
Invisible plot object.
dist_norm <- dist_normal() left <- c(9.5, 10.2, 8.8, 11.1, 9.9) right <- c(10.5, 11.2, 9.8, 12.1, 10.9) fit <- capability_censor(left, right, dist_norm, USL = 13, LSL = 7) autoplot(fit)dist_norm <- dist_normal() left <- c(9.5, 10.2, 8.8, 11.1, 9.9) right <- c(10.5, 11.2, 9.8, 12.1, 10.9) fit <- capability_censor(left, right, dist_norm, USL = 13, LSL = 7) autoplot(fit)
Runs parametric or non-parametric bootstrapping to compute confidence intervals for generalized process capability indices at multiple significance levels (90%, 95%, 99%) under interval-censored data.
boot_ci_censor( fit, B = 2000, alpha = c(0.1, 0.05, 0.01), method = c("percentile", "normal", "basic", "BCa", "BCp", "studentized"), type = c("parametric", "nonparametric"), parallel = FALSE, ncpus = 1 ) gpci_boot_censor( fit, B = 2000, alpha = c(0.1, 0.05, 0.01), method = c("percentile", "normal", "basic", "BCa", "BCp", "studentized"), type = c("parametric", "nonparametric"), parallel = FALSE, ncpus = 1 ) ## S3 method for class 'gpci_ci_censor' print(x, ...) ## S3 method for class 'gpci_ci_censor' summary(object, ...)boot_ci_censor( fit, B = 2000, alpha = c(0.1, 0.05, 0.01), method = c("percentile", "normal", "basic", "BCa", "BCp", "studentized"), type = c("parametric", "nonparametric"), parallel = FALSE, ncpus = 1 ) gpci_boot_censor( fit, B = 2000, alpha = c(0.1, 0.05, 0.01), method = c("percentile", "normal", "basic", "BCa", "BCp", "studentized"), type = c("parametric", "nonparametric"), parallel = FALSE, ncpus = 1 ) ## S3 method for class 'gpci_ci_censor' print(x, ...) ## S3 method for class 'gpci_ci_censor' summary(object, ...)
fit |
A |
B |
Number of bootstrap replicates. |
alpha |
Vector of significance levels (default is 0.10, 0.05, 0.01). |
method |
Confidence interval method ("percentile", "normal", "basic", "BCa", "BCp", "studentized"). |
type |
Bootstrap type ("parametric" or "nonparametric"). |
parallel |
Logical. If TRUE, parallel processing is used. |
ncpus |
Number of CPUs for parallel execution. |
x, object
|
An object of class |
... |
Additional print/summary arguments. |
An object of class gpci_ci_censor.
dist_norm <- dist_normal() left <- c(9.5, 10.2, 8.8, 11.1, 9.9) right <- c(10.5, 11.2, 9.8, 12.1, 10.9) fit <- capability_censor(left, right, dist_norm, USL = 13, LSL = 7) ci <- boot_ci_censor(fit, B = 100, alpha = c(0.10, 0.05, 0.01), method = "percentile") print(ci)dist_norm <- dist_normal() left <- c(9.5, 10.2, 8.8, 11.1, 9.9) right <- c(10.5, 11.2, 9.8, 12.1, 10.9) fit <- capability_censor(left, right, dist_norm, USL = 13, LSL = 7) ci <- boot_ci_censor(fit, B = 100, alpha = c(0.10, 0.05, 0.01), method = "percentile") print(ci)
Convenience constructors for standard process probability distributions.
dist_normal(mean = 0, sd = 1) dist_lognormal(meanlog = 0, sdlog = 1) dist_gamma(shape = 1, scale = 1) dist_weibull(shape = 1, scale = 1) dist_beta(shape1 = 1, shape2 = 1) dist_logistic_exponential(shape = 1, scale = 1)dist_normal(mean = 0, sd = 1) dist_lognormal(meanlog = 0, sdlog = 1) dist_gamma(shape = 1, scale = 1) dist_weibull(shape = 1, scale = 1) dist_beta(shape1 = 1, shape2 = 1) dist_logistic_exponential(shape = 1, scale = 1)
mean, sd
|
Mean and standard deviation parameters for normal distribution. |
meanlog, sdlog
|
Mean and standard deviation of the distribution on the log scale. |
shape, scale
|
Shape and scale parameters. |
shape1, shape2
|
Non-negative parameters of the Beta distribution. |
An object of class gpci_dist_censor.
dist_n <- dist_normal(mean = 10, sd = 2) dist_le <- dist_logistic_exponential(shape = 1.5, scale = 0.5)dist_n <- dist_normal(mean = 10, sd = 2) dist_le <- dist_logistic_exponential(shape = 1.5, scale = 0.5)
Computes classical and generalized Process Capability Indices (PCIs) for interval-censored data.
capability_censor( data_left = NULL, data_right = NULL, distribution, USL, LSL, target = (USL + LSL)/2, indices = c("Cpy", "Cp", "Cpk", "Cpu", "Cpl", "Cpm", "Cpmk"), u = 1, v = 1, mode = c("moments", "quantile"), fit = TRUE, C0 = 1, C1 = 0, C2 = 1, tolerance_t = USL - LSL, P0 = 0.9973002, LDL = LSL, UDL = USL ) ## S3 method for class 'gpcifit_censor' print(x, ...) ## S3 method for class 'gpcifit_censor' summary(object, ...) ## S3 method for class 'gpcifit_censor' coef(object, what = c("indices", "parameters"), ...) ## S3 method for class 'gpcifit_censor' vcov(object, ...) ## S3 method for class 'gpcifit_censor' confint( object, parm = NULL, level = 0.95, B = 1000, method = "percentile", ... )capability_censor( data_left = NULL, data_right = NULL, distribution, USL, LSL, target = (USL + LSL)/2, indices = c("Cpy", "Cp", "Cpk", "Cpu", "Cpl", "Cpm", "Cpmk"), u = 1, v = 1, mode = c("moments", "quantile"), fit = TRUE, C0 = 1, C1 = 0, C2 = 1, tolerance_t = USL - LSL, P0 = 0.9973002, LDL = LSL, UDL = USL ) ## S3 method for class 'gpcifit_censor' print(x, ...) ## S3 method for class 'gpcifit_censor' summary(object, ...) ## S3 method for class 'gpcifit_censor' coef(object, what = c("indices", "parameters"), ...) ## S3 method for class 'gpcifit_censor' vcov(object, ...) ## S3 method for class 'gpcifit_censor' confint( object, parm = NULL, level = 0.95, B = 1000, method = "percentile", ... )
data_left |
Numeric vector of left interval bounds for interval-censored data. |
data_right |
Numeric vector of right interval bounds for interval-censored data. |
distribution |
A |
USL |
Numeric value of the Upper Specification Limit. |
LSL |
Numeric value of the Lower Specification Limit. |
target |
Numeric value of process target (default is midpoint of USL and LSL). |
indices |
Character vector of capability indices to compute. |
u, v
|
Parameters for Vannman's Cp(u,v) family. |
mode |
Computation mode: "moments" or "quantile". |
fit |
Logical. If TRUE, parameters are estimated via MLE under interval censoring. |
C0, C1, C2
|
Cost function parameters for CNpmc and CNpmkc. |
tolerance_t |
Tolerance parameter for CNpmc and CNpmkc. |
P0 |
Desirable process yield for Cpy and Cpc. |
LDL, UDL
|
Desired limits for CpTk. |
x, object
|
An object of class |
what |
Extraction target: "indices" or "parameters". |
parm |
Optional vector of index names. |
level |
Confidence level(s). |
B |
Number of bootstrap replicates. |
method |
Bootstrap CI method. |
... |
Additional arguments. |
An object of class gpcifit_censor.
dist_norm <- dist_normal() left <- c(9.5, 10.2, 8.8, 11.1, 9.9) right <- c(10.5, 11.2, 9.8, 12.1, 10.9) capability_censor( data_left = left, data_right = right, distribution = dist_norm, USL = 13, LSL = 7, target = 10, indices = c("Cpy", "Cp", "Cpk", "Cpm", "Cpmk"), mode = "moments" )dist_norm <- dist_normal() left <- c(9.5, 10.2, 8.8, 11.1, 9.9) right <- c(10.5, 11.2, 9.8, 12.1, 10.9) capability_censor( data_left = left, data_right = right, distribution = dist_norm, USL = 13, LSL = 7, target = 10, indices = c("Cpy", "Cp", "Cpk", "Cpm", "Cpmk"), mode = "moments" )
Computes standard errors, mean squared errors, and coverage probabilities for distribution parameters and process capability indices using bootstrap results.
compute_diagnostics_censor( fit, true_params = NULL, true_indices = NULL, B = 1000, alpha = c(0.1, 0.05, 0.01) ) gpci_diagnostics_censor( fit, true_params = NULL, true_indices = NULL, B = 1000, alpha = c(0.1, 0.05, 0.01) ) ## S3 method for class 'gpci_diagnostics_censor' print(x, ...) ## S3 method for class 'gpci_diagnostics_censor' summary(object, ...)compute_diagnostics_censor( fit, true_params = NULL, true_indices = NULL, B = 1000, alpha = c(0.1, 0.05, 0.01) ) gpci_diagnostics_censor( fit, true_params = NULL, true_indices = NULL, B = 1000, alpha = c(0.1, 0.05, 0.01) ) ## S3 method for class 'gpci_diagnostics_censor' print(x, ...) ## S3 method for class 'gpci_diagnostics_censor' summary(object, ...)
fit |
A |
true_params |
Named list of true parameter values (if known). |
true_indices |
Named vector of true index values (if known). |
B |
Number of bootstrap replicates for SE computation. |
alpha |
Vector of significance levels for coverage probability. |
x, object
|
An object of class |
... |
Additional print/summary arguments. |
A list of class gpci_diagnostics_censor.
dist_norm <- dist_normal() left <- c(9.5, 10.2, 8.8, 11.1, 9.9) right <- c(10.5, 11.2, 9.8, 12.1, 10.9) fit <- capability_censor(left, right, dist_norm, USL = 13, LSL = 7) diagnostics <- compute_diagnostics_censor(fit, B = 100) print(diagnostics)dist_norm <- dist_normal() left <- c(9.5, 10.2, 8.8, 11.1, 9.9) right <- c(10.5, 11.2, 9.8, 12.1, 10.9) fit <- capability_censor(left, right, dist_norm, USL = 13, LSL = 7) diagnostics <- compute_diagnostics_censor(fit, B = 100) print(diagnostics)
Computes the theoretical mean and variance of a gpci_dist_censor object using numerical integration.
compute_theoretical_moments_censor(dist)compute_theoretical_moments_censor(dist)
dist |
A |
A list with mean and var.
dist_n <- dist_normal(mean = 5, sd = 1.5) compute_theoretical_moments_censor(dist_n)dist_n <- dist_normal(mean = 5, sd = 1.5) compute_theoretical_moments_censor(dist_n)
Constructor to define a probability distribution for process capability analysis under interval-censored data.
define_distribution_censor( name, pdf = NULL, cdf = NULL, sf = NULL, quantile = NULL, params = list(), support = c(-Inf, Inf) ) gpci_dist_censor( name, pdf = NULL, cdf = NULL, sf = NULL, quantile = NULL, params = list(), support = c(-Inf, Inf) )define_distribution_censor( name, pdf = NULL, cdf = NULL, sf = NULL, quantile = NULL, params = list(), support = c(-Inf, Inf) ) gpci_dist_censor( name, pdf = NULL, cdf = NULL, sf = NULL, quantile = NULL, params = list(), support = c(-Inf, Inf) )
name |
Character string naming the distribution. |
pdf |
Function representing the probability density function (PDF/PMF). |
cdf |
Function representing the cumulative distribution function (CDF). |
sf |
Function representing the survival function (SF = 1 - CDF). |
quantile |
Function representing the quantile function. |
params |
Named list of parameters for the distribution. |
support |
Vector of length 2 defining lower and upper bounds of support. |
An object of class gpci_dist_censor.
custom_weib <- define_distribution_censor( name = "custom_weibull", sf = function(x, shape, scale) pweibull(x, shape, scale, lower.tail = FALSE), params = list(shape = 2, scale = 10), support = c(0, Inf) )custom_weib <- define_distribution_censor( name = "custom_weibull", sf = function(x, shape, scale) pweibull(x, shape, scale, lower.tail = FALSE), params = list(shape = 2, scale = 10), support = c(0, Inf) )
Fits the parameters of a gpci_dist_censor distribution to interval-censored data
using Maximum Likelihood Estimation (MLE) via the MleCensoR package.
fit_distribution_censor(data_left, data_right, dist, start = NULL) gpci_fit_censor(data_left, data_right, dist, start = NULL)fit_distribution_censor(data_left, data_right, dist, start = NULL) gpci_fit_censor(data_left, data_right, dist, start = NULL)
data_left |
Numeric vector of left interval bounds for interval-censored data. |
data_right |
Numeric vector of right interval bounds for interval-censored data. |
dist |
A |
start |
Optional named list of starting parameter values. |
A new gpci_dist_censor object containing fitted parameters.
dist_norm <- dist_normal() left <- c(9.5, 10.2, 8.8, 11.1, 9.9) right <- c(10.5, 11.2, 9.8, 12.1, 10.9) fit <- fit_distribution_censor(left, right, dist_norm)dist_norm <- dist_normal() left <- c(9.5, 10.2, 8.8, 11.1, 9.9) right <- c(10.5, 11.2, 9.8, 12.1, 10.9) fit <- fit_distribution_censor(left, right, dist_norm)
Dispatcher for Single Index Computation under Interval Censoring
gpci_index(fit, index)gpci_index(fit, index)
fit |
A |
index |
Name of index to compute. |
Numeric value of the specified index.
dist_norm <- dist_normal() left <- c(9.5, 10.2, 8.8, 11.1, 9.9) right <- c(10.5, 11.2, 9.8, 12.1, 10.9) fit <- capability_censor(left, right, dist_norm, USL = 13, LSL = 7) gpci_index(fit, "Cpy")dist_norm <- dist_normal() left <- c(9.5, 10.2, 8.8, 11.1, 9.9) right <- c(10.5, 11.2, 9.8, 12.1, 10.9) fit <- capability_censor(left, right, dist_norm, USL = 13, LSL = 7) gpci_index(fit, "Cpy")
Visualizes bootstrap confidence intervals across different significance levels.
## S3 method for class 'gpci_ci_censor' plot(x, ...)## S3 method for class 'gpci_ci_censor' plot(x, ...)
x |
An object of class |
... |
Additional graphical parameters. |
Invisible CI object x.
dist_norm <- dist_normal() left <- c(9.5, 10.2, 8.8, 11.1, 9.9) right <- c(10.5, 11.2, 9.8, 12.1, 10.9) fit <- capability_censor(left, right, dist_norm, USL = 13, LSL = 7) ci <- boot_ci_censor(fit, B = 100, alpha = c(0.10, 0.05, 0.01), method = "percentile") plot(ci)dist_norm <- dist_normal() left <- c(9.5, 10.2, 8.8, 11.1, 9.9) right <- c(10.5, 11.2, 9.8, 12.1, 10.9) fit <- capability_censor(left, right, dist_norm, USL = 13, LSL = 7) ci <- boot_ci_censor(fit, B = 100, alpha = c(0.10, 0.05, 0.01), method = "percentile") plot(ci)
Visualizes standard errors for parameters and capability indices.
## S3 method for class 'gpci_diagnostics_censor' plot(x, ...)## S3 method for class 'gpci_diagnostics_censor' plot(x, ...)
x |
An object of class |
... |
Additional graphical parameters. |
Invisible diagnostics object x.
dist_norm <- dist_normal() left <- c(9.5, 10.2, 8.8, 11.1, 9.9) right <- c(10.5, 11.2, 9.8, 12.1, 10.9) fit <- capability_censor(left, right, dist_norm, USL = 13, LSL = 7) diag_obj <- compute_diagnostics_censor(fit, B = 100) plot(diag_obj)dist_norm <- dist_normal() left <- c(9.5, 10.2, 8.8, 11.1, 9.9) right <- c(10.5, 11.2, 9.8, 12.1, 10.9) fit <- capability_censor(left, right, dist_norm, USL = 13, LSL = 7) diag_obj <- compute_diagnostics_censor(fit, B = 100) plot(diag_obj)
Visualizes interval-censored observations, fitted distribution density curve, and specification limits.
## S3 method for class 'gpcifit_censor' plot(x, main = "Process Capability Analysis (Interval-Censored)", ...)## S3 method for class 'gpcifit_censor' plot(x, main = "Process Capability Analysis (Interval-Censored)", ...)
x |
An object of class |
main |
Title of the plot. |
... |
Additional graphical parameters. |
Invisible fit object x.
dist_norm <- dist_normal() left <- c(9.5, 10.2, 8.8, 11.1, 9.9) right <- c(10.5, 11.2, 9.8, 12.1, 10.9) fit <- capability_censor(left, right, dist_norm, USL = 13, LSL = 7) plot(fit)dist_norm <- dist_normal() left <- c(9.5, 10.2, 8.8, 11.1, 9.9) right <- c(10.5, 11.2, 9.8, 12.1, 10.9) fit <- capability_censor(left, right, dist_norm, USL = 13, LSL = 7) plot(fit)