---
title: "Generalized Process Capability Indices for Progressive Type-II Censored Data"
author: "Shikhar Tyagi, Sumit Kumar, Arvind Pandey, Bhupendra Singh, Vrijesh Tripathi"
date: "`r Sys.Date()`"
output: rmarkdown::html_vignette
vignette: >
  %\VignetteIndexEntry{Generalized Process Capability Indices for Progressive Type-II Censored Data}
  %\VignetteEngine{knitr::rmarkdown}
  %\VignetteEncoding{UTF-8}
---

```{r setup, include = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
library(gpciProgTyII)
```

# Introduction

The `gpciProgTyII` package provides a unified statistical framework for evaluating classical and Generalized Process Capability Indices (GPCIs) under Progressive Type-II Censored Data.

Key features include:
1. Parameter estimation for progressive Type-II censored data using the `MleCensoR` package (`mle_progressive_type2`).
2. Evaluation of GPCIs including $C_{py}$, $S_{pmk}$, $C_{pTk}$, $C_{pc}$, $C_{Npmc}$, $C_{Npmkc}$, $C_{Npk}$, and Vännman's $C_p(u,v)$ family.
3. Computation of parametric and non-parametric bootstrap confidence intervals at 90%, 95%, and 99% levels of significance.
4. Calculation of Standard Errors (SE), Mean Squared Error (MSE), Bias, and empirical coverage probabilities for model parameters and capability indices.

# Example: Progressive Type-II Censored Analysis

```{r 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)
```
