## ----setup, include = FALSE---------------------------------------------------
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
library(gpciProgTyII)

## ----example------------------------------------------------------------------
# Load distribution and define progressive data
dist_w <- dist_weibull(shape = 1.5, scale = 4.0)

# Observed failure times under progressive censoring
x <- c(0.8, 1.5, 2.3, 3.1, 4.2)
r_scheme <- c(1, 0, 2, 0, 1)

# Fit model parameters and compute capability indices
fit <- capability_prog(
  x = x, r_removals = r_scheme,
  distribution = dist_w,
  USL = 6.0, LSL = 0.5, target = 3.25,
  indices = c("Cpy", "Cp", "Cpk", "Cpm", "CpTk", "Spmk", "CNpmc")
)

print(fit)

# Compute Bootstrap Confidence Intervals at 90%, 95%, and 99%
ci <- boot_ci_prog(fit, B = 50, alpha = c(0.10, 0.05, 0.01), method = "percentile")
print(ci)

