The gpcihybridIImcmc package provides Bayesian Markov
Chain Monte Carlo (MCMC) estimation methods using Metropolis-Hastings
within Gibbs sampler for Generalized Process Capability Indices (GPCIs)
under Hybrid Type-II censored lifetime data.
Under Hybrid Type-II censoring (Epstein 1954; Childs et al. 2003; Kundu and Pradhan 2009), \(n\) identical units are placed on life testing. The experiment stops at \(T^* = \max(x_r, T_c)\), where \(r \le n\) is the target number of failures and \(T_c > 0\) is the pre-fixed censoring time.
Supported capability indices include \(C_{py}\), \(C_p\), \(C_{pk}\), \(C_{pu}\), \(C_{pl}\), \(C_{pm}\), \(C_{pmk}\), \(S_{pmk}\), \(C_{pTk}\), \(C_{pc}\), \(C_{Np}\), \(C_{Npk}\), \(C_{Npm}\), \(C_{Npmk}\), \(C_{Npmc}\), and \(C_{Npmkc}\).
Users can pass custom probability density/mass functions
(pdf), cumulative distribution functions
(cdf), and survival functions (surv) as R
functions:
library(gpcihybridIImcmc)
# User-defined Exponential lifetime distribution functions
my_pdf <- function(x, rate) stats::dexp(x, rate = rate)
my_cdf <- function(q, rate) stats::pexp(q, rate = rate)
my_surv <- function(q, rate) stats::pexp(q, rate = rate, lower.tail = FALSE)
# Hybrid Type-II censored sample: n = 10 units, target r = 3, censoring time tc = 2.5
data <- c(0.5, 1.2, 2.1, 3.4)
fit <- gpci_hybrid2_mcmc(
x = data,
r = 3,
tc = 2.5,
n = 10,
pdf = my_pdf,
cdf = my_cdf,
surv = my_surv,
param_names = "rate",
start = c(rate = 0.5),
length_chain = 1000,
burn_in = 200,
thinning = 2,
USL = 8,
LSL = 0,
target = 4
)
print(fit)
#> --- Bayesian MCMC Estimation of GPCIs under Hybrid Type-II Censoring ---
#> Distribution: Custom
#> Observed Failures (d): 4 | Target (r): 3 | Total (n): 10
#> Censoring Time (Tc): 2.5 | Effective Termination (T*): 2.5
#> Specification Limits: LSL = 0 | Target = 4 | USL = 8
#>
#> Initial Parameter MLEs (under Hybrid Type-II Censoring):
#> rate
#> 0.1803
#>
#> Point Estimates of GPCIs (at Initial Estimates):
#> Cpy Cp Cpk Cpm Cpmk Spmk CNpmc
#> 0.7657 0.2404 0.1474 0.2315 0.1420 0.3802 0.2154
#>
#> Posterior GPCI Summary (Thinned MCMC Chain):
#> Variable Estimate Bias MSE Bayes_Risk HPD_95_Lower HPD_95_Upper
#> 1 Cpy 0.7046 -0.0611 0.0372 0.0336 0.4412 0.9936
#> 2 Cp 0.2739 0.0336 0.0408 0.0398 0.0848 0.7291
#> 3 Cpk 0.0855 -0.0619 0.0326 0.0289 -0.1400 0.3333
#> 4 Cpm 0.2268 -0.0047 0.0192 0.0193 0.0788 0.4714
#> 5 Cpmk 0.0716 -0.0704 0.0241 0.0192 -0.1306 0.3022
#> 6 Spmk 0.3409 -0.0393 0.0220 0.0205 0.1584 0.5854
#> 7 CNpmc 0.2014 -0.0140 0.0104 0.0103 0.0823 0.3776
#> HW_Passed
#> 1 TRUE
#> 2 TRUE
#> 3 TRUE
#> 4 TRUE
#> 5 TRUE
#> 6 TRUE
#> 7 TRUEThe package automatically calculates: - Point estimates and initial MLE estimates under Hybrid Type-II censoring. - Posterior mean estimates, bias, Mean Squared Error (MSE), and Bayes Risk under squared error loss. - Highest Posterior Density (HPD) credible intervals at 90%, 95%, and 99% levels. - Heidelberger and Welch’s MCMC Convergence Diagnostics (stationarity and half-width tests). - Empirical coverage probabilities.