The gpcihybridIILinApp package provides a comprehensive
framework for computing, estimating, and validating Generalized Process
Capability Indices (GPCIs) using the Lindley Approximation
Method for Hybrid Type-II censored lifetime data under Bayesian
inference.
Under Hybrid Type-II censoring with initial sample size \(n\), target failures \(r\), and censoring time \(T_c\), the experiment terminates at time: \[T^* = \max(x_r, T_c)\] The likelihood function based on observed failure times \(x = (x_1, \dots, x_d)\) (\(d \ge r\)) is: \[L(\theta \mid x, r, T_c, n) = \left[ \prod_{i=1}^d f(x_i; \theta) \right] [S(T^*; \theta)]^{n-d}\]
Supported GPCIs include: - \(C_{py}\) (Process Capability Index based on Yield; Maiti et al., 2010) - \(C_p, C_{pk}, C_{pu}, C_{pl}, C_{pm}, C_{pmk}\) (Classical capability indices) - \(C_{pTk}\) (Saha et al., 2019) - \(S_{pmk}\) (Dey & Saha, 2019) - \(C_{pc}\) (Saha et al., 2022) - \(CN_{pk}\) (Saha et al., 2018) - \(CN_{pmc}\) (Alotaibi et al., 2022) - \(CN_{pmkc}\) (Saha et al., 2024) - \(C_p(u,v), CN_p(u,v)\) (Vännman’s generalized family) - Quantile-based analogs (\(C_{p,q}, C_{pk,q}, C_{pu,q}, C_{pl,q}, C_{pm,q}, C_{pmk,q}\))
Below is an example estimating GPCIs for Hybrid Type-II censored data
using the high-level user interface function
gpci_lindley_hybrid2():
set.seed(42)
x_obs <- c(0.2, 0.5, 0.8, 1.1, 1.4)
fit_res <- gpci_lindley_hybrid2(
x = x_obs, r = 3, tc = 1.2, n = 10,
pdf = function(x, rate = 1) stats::dexp(x, rate = rate),
cdf = function(x, rate = 1) stats::pexp(x, rate = rate),
sf = function(x, rate = 1) stats::pexp(x, rate = rate, lower.tail = FALSE),
chain_length = 50,
burn_in = 10,
thinning = 1,
USL = 3,
LSL = 0,
target = 1.5,
indices = c("Cpy", "Cp", "Cpk", "Cpm", "CNpmc"),
B = 20
)
# Display Summary Diagnostics Table
summary(fit_res)
#> Index MLE_Estimate Lindley_Estimate Chain_Mean Bias MSE Risk_Value
#> 1 Cpy 9.826530e-01 9.826530e-01 9.826530e-01 0 0 0
#> 2 Cp 5.000000e+03 5.000000e+03 5.000000e+03 0 0 0
#> 3 Cpk 0.000000e+00 0.000000e+00 0.000000e+00 0 0 0
#> 4 Cpm 3.333333e-01 3.333333e-01 3.333333e-01 0 0 0
#> 5 CNpmc 2.328306e-11 2.328306e-11 2.328306e-11 0 0 0
#> HPD90_Lower HPD90_Upper HPD95_Lower HPD95_Upper HPD99_Lower HPD99_Upper
#> 1 9.826530e-01 9.826530e-01 9.826530e-01 9.826530e-01 9.826530e-01 9.826530e-01
#> 2 5.000000e+03 5.000000e+03 5.000000e+03 5.000000e+03 5.000000e+03 5.000000e+03
#> 3 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00
#> 4 3.333333e-01 3.333333e-01 3.333333e-01 3.333333e-01 3.333333e-01 3.333333e-01
#> 5 2.328306e-11 2.328306e-11 2.328306e-11 2.328306e-11 2.328306e-11 2.328306e-11
#> HW_Stat HW_Pvalue HW_Passed Convergence_Prob Boot95_Lower Boot95_Upper
#> 1 0 0.5 TRUE 0.5 0.9527853 0.9527853
#> 2 0 0.5 TRUE 0.5 0.5123905 0.5123905
#> 3 0 0.5 TRUE 0.5 0.3388922 0.3388922
#> 4 0 0.5 TRUE 0.5 0.4545094 0.4545094
#> 5 0 0.5 TRUE 0.5 0.2954846 0.2954846The package provides pre-defined distribution objects such as
dist_exponential(), dist_weibull(),
dist_gamma(), dist_normal(),
dist_lognormal(), dist_logistic(), and
dist_loglogistic():
dist_exp <- dist_exponential(rate = 1)
fit_exp <- lindley_gpci_hybrid2(
x = x_obs, r = 3, tc = 1.2, n = 10,
distribution = dist_exp,
chain_length = 50,
burn_in = 10,
thinning = 1,
USL = 3,
LSL = 0,
target = 1.5,
indices = c("Cpy", "Cp", "Cpk", "Cpm", "CNpmc"),
B = 20
)
summary(fit_exp)
#> Index MLE_Estimate Lindley_Estimate Chain_Mean Bias MSE
#> 1 Cpy 0.7789735 0.7960890 0.7926165 0.01364305 0.019114971
#> 2 Cp 0.2500004 0.3002505 0.2956360 0.04563563 0.014370784
#> 3 Cpk 0.1666675 0.2671676 0.2030214 0.03635391 0.024855649
#> 4 Cpm 0.2425361 0.2978745 0.2830799 0.04054378 0.012987002
#> 5 CNpmc 0.2065101 0.2225041 0.2188001 0.01229003 0.003819121
#> Risk_Value HPD90_Lower HPD90_Upper HPD95_Lower HPD95_Upper HPD99_Lower
#> 1 0.019301528 0.59712146 0.9611374 0.5203717 0.9611374 0.36923108
#> 2 0.016469326 0.07653943 0.4312088 0.1219698 0.5305144 0.07653943
#> 3 0.026185300 -0.03162445 0.3333333 -0.0893937 0.3333333 -0.18025447
#> 4 0.014641965 0.13232403 0.4566070 0.1030072 0.4566070 0.06063325
#> 5 0.003970476 0.12929864 0.2991386 0.1038689 0.2991386 0.06354932
#> HPD99_Upper HW_Stat HW_Pvalue HW_Passed Convergence_Prob Boot95_Lower
#> 1 0.9611374 0.04717302 0.5 TRUE 0.5 0.58973735
#> 2 0.5305144 0.05605243 0.5 TRUE 0.5 0.14800487
#> 3 0.3333333 0.05114820 0.5 TRUE 0.5 -0.03732359
#> 4 0.4566070 0.05641950 0.5 TRUE 0.5 0.12940756
#> 5 0.2991386 0.05005141 0.5 TRUE 0.5 0.12679321
#> Boot95_Upper
#> 1 0.9400568
#> 2 0.4627408
#> 3 0.3333333
#> 4 0.4309856
#> 5 0.2895360Goodness-of-fit testing under Hybrid Type-II censoring can be
performed directly using gof_test_hybrid2():
gof_res <- gof_test_hybrid2(
fit = fit_exp,
p.method = "asymptotic"
)
print(gof_res)
#> --- Goodness-of-Fit Test (Hybrid Type-II Censored Data) ---
#> Distribution: Exponential
#> Test Method: Error in gofPHCS::gof_test: Asymptotic p-value method is not available for statistic 'KSII'. Use p.method = 'montecarlo'.
#> Statistic: Error = 0
#> p-value: 1