| Type: | Package |
| Title: | Generalized Process Capability Indices for Interval-Censored Data |
| Version: | 0.1.0 |
| 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>. |
| License: | MIT + file LICENSE |
| Encoding: | UTF-8 |
| RoxygenNote: | 7.3.3 |
| Depends: | R (≥ 4.0.0) |
| Imports: | stats, graphics, numDeriv, boot, MleCensoR |
| Suggests: | testthat (≥ 3.0.0), knitr, rmarkdown |
| VignetteBuilder: | knitr |
| Config/testthat/edition: | 3 |
| NeedsCompilation: | no |
| Packaged: | 2026-08-03 19:18:25 UTC; shikhar tyagi |
| Author: | Shikhar Tyagi |
| Maintainer: | Shikhar Tyagi <shikhar1093tyagi@gmail.com> |
| Repository: | CRAN |
| Date/Publication: | 2026-08-08 13:00:02 UTC |
Autoplot Generic and Methods for Compatibility
Description
Autoplot Generic and Methods for Compatibility
Usage
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, ...)
Arguments
object |
Object to plot. |
... |
Additional arguments. |
Value
Invisible plot object.
Examples
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)
Compute Bootstrap Confidence Intervals for Process Capability Indices (Interval-Censored Data)
Description
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.
Usage
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, ...)
Arguments
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. |
Value
An object of class gpci_ci_censor.
Examples
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)
Built-in Process Distributions for Interval-Censored Analysis
Description
Convenience constructors for standard process probability distributions.
Usage
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)
Arguments
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. |
Value
An object of class gpci_dist_censor.
Examples
dist_n <- dist_normal(mean = 10, sd = 2)
dist_le <- dist_logistic_exponential(shape = 1.5, scale = 0.5)
Compute Process Capability Indices for Interval-Censored Data
Description
Computes classical and generalized Process Capability Indices (PCIs) for interval-censored data.
Usage
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",
...
)
Arguments
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. |
Value
An object of class gpcifit_censor.
Examples
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"
)
Compute Standard Errors, MSE, and Coverage Probabilities for Interval-Censored Data
Description
Computes standard errors, mean squared errors, and coverage probabilities for distribution parameters and process capability indices using bootstrap results.
Usage
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, ...)
Arguments
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. |
Value
A list of class gpci_diagnostics_censor.
Examples
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)
Compute Theoretical Moments of an Interval-Censored Distribution
Description
Computes the theoretical mean and variance of a gpci_dist_censor object using numerical integration.
Usage
compute_theoretical_moments_censor(dist)
Arguments
dist |
A |
Value
A list with mean and var.
Examples
dist_n <- dist_normal(mean = 5, sd = 1.5)
compute_theoretical_moments_censor(dist_n)
Define a Process Distribution for Interval-Censored Data
Description
Constructor to define a probability distribution for process capability analysis under interval-censored data.
Usage
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)
)
Arguments
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. |
Value
An object of class gpci_dist_censor.
Examples
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)
)
Fit Distribution Parameters under Interval-Censored Data
Description
Fits the parameters of a gpci_dist_censor distribution to interval-censored data
using Maximum Likelihood Estimation (MLE) via the MleCensoR package.
Usage
fit_distribution_censor(data_left, data_right, dist, start = NULL)
gpci_fit_censor(data_left, data_right, dist, start = NULL)
Arguments
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. |
Value
A new gpci_dist_censor object containing fitted parameters.
Examples
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
Description
Dispatcher for Single Index Computation under Interval Censoring
Usage
gpci_index(fit, index)
Arguments
fit |
A |
index |
Name of index to compute. |
Value
Numeric value of the specified index.
Examples
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")
Plot Method for gpci_ci_censor Objects
Description
Visualizes bootstrap confidence intervals across different significance levels.
Usage
## S3 method for class 'gpci_ci_censor'
plot(x, ...)
Arguments
x |
An object of class |
... |
Additional graphical parameters. |
Value
Invisible CI object x.
Examples
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)
Plot Method for gpci_diagnostics_censor Objects
Description
Visualizes standard errors for parameters and capability indices.
Usage
## S3 method for class 'gpci_diagnostics_censor'
plot(x, ...)
Arguments
x |
An object of class |
... |
Additional graphical parameters. |
Value
Invisible diagnostics object x.
Examples
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)
Plot Method for gpcifit_censor Objects
Description
Visualizes interval-censored observations, fitted distribution density curve, and specification limits.
Usage
## S3 method for class 'gpcifit_censor'
plot(x, main = "Process Capability Analysis (Interval-Censored)", ...)
Arguments
x |
An object of class |
main |
Title of the plot. |
... |
Additional graphical parameters. |
Value
Invisible fit object x.
Examples
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)