Package {ImpAdaptType2Censor}


Type: Package
Title: Data Generation and Statistical Inference for Improved Adaptive Type-II Progressive Censoring Schemes
Version: 0.1.0
Description: Comprehensive computational routines for random data generation, Maximum Likelihood Estimation (MLE), Maximum Product of Spacings Estimation (MPSE), and MCMC Bayesian estimation under the Improved Adaptive Type-II Progressive Censoring Scheme (IAT-II PCS). Users can supply custom probability density functions (PDF), cumulative distribution functions (CDF), survival functions, parameter ranges, and progressive censoring plans for any continuous univariate lifetime distribution, or rely on built-in parametric models (e.g., Generalized Exponential). Point estimation methods include MLE via optimization algorithms (Broyden-Fletcher-Goldfarb-Shanno (BFGS), Newton-Raphson (NR), Nelder-Mead (NM), Conjugate Gradients (CG), L-BFGS-B, Simulated Annealing (SANN), and Berndt-Hall-Hall-Hausman (BHHH)) and MPSE. Bayesian inference utilizes Metropolis-Hastings within Gibbs sampling under Squared Error Loss (SEL) and LINEX Loss (LL) functions to compute point estimates and Highest Posterior Density (HPD) credible intervals. Asymptotic confidence intervals for parameters, reliability, and hazard rate functions are constructed using asymptotic normality and delta method. Methods are based on Dev and Chacko (2026, Journal of the Iranian Statistical Society, 25, 1-29), Yan, Zhang, and Dong (2021, Journal of Computational and Applied Mathematics, 381, 113022, <doi:10.1016/j.cam.2020.113022>), Ng, Kundu, and Chan (2004, Naval Research Logistics, 51, 1145-1168, <doi:10.1002/nav.20045>), Cheng and Amin (1983, Journal of the Royal Statistical Society Series B, 45, 394-403, <doi:10.1111/j.2517-6161.1983.tb01268.x>), Kundu and Gupta (1999, Australian & New Zealand Journal of Statistics, 41, 173-188, <doi:10.1111/1467-842X.00072>), and Berndt, Hall, Hall, and Hausman (1974, Annals of Economic and Social Measurement, 3, 653-665).
License: GPL (≥ 3)
Encoding: UTF-8
RoxygenNote: 7.3.3
Depends: R (≥ 4.0.0)
Imports: stats, graphics, grDevices
Suggests: testthat (≥ 3.0.0)
NeedsCompilation: no
Packaged: 2026-07-29 16:04:53 UTC; shikhar tyagi
Author: Shikhar Tyagi ORCID iD [aut, cre], Arvind Pandey [aut], Bhupendra Singh [aut], Vrijesh Tripathi [aut]
Maintainer: Shikhar Tyagi <shikhar1093tyagi@gmail.com>
Repository: CRAN
Date/Publication: 2026-08-07 15:30:02 UTC

Bayesian MCMC Estimation under Improved Adaptive Type-II Progressive Censoring Scheme

Description

Performs MCMC Bayesian estimation for Improved Adaptive Type-II Progressive Censored (IAT-II PCS) data using Metropolis-Hastings within Gibbs sampling under Squared Error Loss (SEL) and LINEX Loss (LL) functions.

Usage

bayes_impadapt2_censor(
  data,
  n = NULL,
  m = NULL,
  T1 = NULL,
  T2 = NULL,
  R = NULL,
  pdf = NULL,
  cdf = NULL,
  start = NULL,
  prior_mean = NULL,
  prior_sd = NULL,
  loss = c("squared", "linex"),
  c_linex = 1,
  n_iter = 5000,
  burn_in = 1000,
  thin = 1,
  conf_level = 0.95,
  eval_time = NULL,
  seed = NULL,
  proposal_sd = NULL
)

Arguments

data

Numeric vector of observed failure times, or an object of class "impadapt2_sample".

n

Integer, total number of units placed on test. Required if data is a numeric vector.

m

Integer, pre-fixed target number of failures. Required if data is a numeric vector.

T1

Numeric, first threshold time point T1. Required if data is a numeric vector.

T2

Numeric or NULL, second threshold time point T2 (T2 > T1). Required if data is a numeric vector.

R

Numeric vector of length m, pre-fixed progressive censoring scheme. Required if data is a numeric vector.

pdf

Function (optional), user-supplied probability density function pdf(x, par).

cdf

Function (optional), user-supplied cumulative distribution function cdf(x, par).

start

Numeric vector of initial parameter values.

prior_mean

Optional numeric vector of prior means for parameters.

prior_sd

Optional numeric vector of prior standard deviations for parameters.

loss

Character vector specifying loss function(s) to compute: "squared" (Squared Error Loss) and/or "linex" (LINEX Loss).

c_linex

Numeric, shape parameter c for LINEX loss function (default 1.0).

n_iter

Integer, total number of MCMC iterations (default 5000).

burn_in

Integer, number of initial burn-in iterations to discard (default 1000).

thin

Integer, thinning interval (default 1).

conf_level

Numeric, credible level for HPD intervals (default 0.95).

eval_time

Optional numeric, time point t > 0 for calculating reliability S(t) and hazard rate h(t).

seed

Optional integer, seed for random number generation.

proposal_sd

Optional numeric vector of proposal standard deviations for Metropolis-Hastings steps.

Value

An object of class "impadapt2_bayes" containing:

bayes_sel

Bayes point estimates under Squared Error Loss.

bayes_linex

Bayes point estimates under LINEX Loss.

post_sd

Posterior standard deviations of parameters.

hpd_interval

Matrix of Highest Posterior Density (HPD) credible intervals for parameters.

chain

Matrix of retained MCMC posterior samples.

rel_est

Bayes estimates, SD, and HPD interval for Reliability S(t) if eval_time is provided.

haz_est

Bayes estimates, SD, and HPD interval for Hazard rate h(t) if eval_time is provided.

acceptance_rate

Acceptance rate of the Metropolis-Hastings MCMC sampler.

case

Realized censoring scenario ("Case I", "Case II", or "Case III").

References

Dev, S. S., & Chacko, M. (2026). Statistical inference for generalized exponential distribution under improved adaptive Type-II progressive censoring. Journal of the Iranian Statistical Society, 25(2), 1-29. DOI: 10.22034/jirss.2026.2077492.1165.

Examples

set.seed(123)
ge_cdf <- function(x, par) (1 - exp(-par[2] * x))^par[1]
ge_pdf <- function(x, par) par[1] * par[2] * exp(-par[2] * x) * (1 - exp(-par[2] * x))^(par[1] - 1)
ge_qdf <- function(p, par) - (1 / par[2]) * log(1 - p^(1 / par[1]))

samp <- r_impadapt2_censor(
  n = 20, m = 10, T1 = 0.8, T2 = 2.0,
  R = c(rep(1, 10)),
  pdf = ge_pdf, cdf = ge_cdf, qdf = ge_qdf,
  par = c(1.5, 0.8)
)

fit_bayes <- bayes_impadapt2_censor(
  data = samp, pdf = ge_pdf, cdf = ge_cdf,
  start = c(1.2, 0.7), n_iter = 1000, burn_in = 200, eval_time = 0.5
)
summary(fit_bayes)

Maximum Likelihood Estimation under Improved Adaptive Type-II Progressive Censoring Scheme

Description

Fits a probability distribution to Improved Adaptive Type-II Progressive Censored (IAT-II PCS) data using Maximum Likelihood Estimation (MLE).

Usage

mle_impadapt2_censor(
  data,
  n = NULL,
  m = NULL,
  T1 = NULL,
  T2 = NULL,
  R = NULL,
  pdf = NULL,
  cdf = NULL,
  start = NULL,
  lower = NULL,
  upper = NULL,
  method = "BFGS",
  conf_level = 0.95,
  eval_time = NULL,
  ...
)

Arguments

data

Numeric vector of observed failure times, or an object of class "impadapt2_sample".

n

Integer, total number of units placed on test. Required if data is a numeric vector.

m

Integer, pre-fixed target number of failures. Required if data is a numeric vector.

T1

Numeric, first threshold time point T1. Required if data is a numeric vector.

T2

Numeric or NULL, second threshold time point T2 (T2 > T1). Required if data is a numeric vector.

R

Numeric vector of length m, pre-fixed progressive censoring scheme. Required if data is a numeric vector.

pdf

Function (optional), user-supplied probability density function pdf(x, par).

cdf

Function (optional), user-supplied cumulative distribution function cdf(x, par).

start

Numeric vector of initial parameter guesses.

lower

Optional numeric vector of lower parameter bounds.

upper

Optional numeric vector of upper parameter bounds.

method

Character string specifying optimization method: "BFGS", "NR", "Nelder-Mead", "CG", "L-BFGS-B", "SANN", or "BHHH". Default is "BFGS".

conf_level

Numeric, confidence level for asymptotic confidence intervals (default 0.95).

eval_time

Optional numeric, time point t > 0 for calculating reliability S(t) and hazard rate h(t).

...

Further arguments passed to optimization routines.

Value

An object of class "impadapt2_mle" containing:

par

MLE parameter estimates.

std_er

Standard errors of parameter estimates.

vcov

Variance-covariance matrix.

loglik

Log-likelihood value at MLE.

aic

Akaike Information Criterion (AIC).

bic

Bayesian Information Criterion (BIC).

confint

Matrix of asymptotic confidence intervals for parameters.

rel_est

Point estimate, SE, and ACI of Reliability function S(t) if eval_time is provided.

haz_est

Point estimate, SE, and ACI of Hazard rate function h(t) if eval_time is provided.

case

Realized censoring scenario ("Case I", "Case II", or "Case III").

method

Optimization routine used.

convergence

Convergence code (0 = successful convergence).

References

Dev, S. S., & Chacko, M. (2026). Statistical inference for generalized exponential distribution under improved adaptive Type-II progressive censoring. Journal of the Iranian Statistical Society, 25(2), 1-29. DOI: 10.22034/jirss.2026.2077492.1165.

Berndt, E. R., Hall, B. H., Hall, R. E., & Hausman, J. A. (1974). Estimation and inference in nonlinear structural models. Annals of Economic and Social Measurement, 3(4), 653-665.

Examples

set.seed(123)
ge_cdf <- function(x, par) (1 - exp(-par[2] * x))^par[1]
ge_pdf <- function(x, par) par[1] * par[2] * exp(-par[2] * x) * (1 - exp(-par[2] * x))^(par[1] - 1)
ge_qdf <- function(p, par) - (1 / par[2]) * log(1 - p^(1 / par[1]))

samp <- r_impadapt2_censor(
  n = 25, m = 12, T1 = 0.8, T2 = 2.0,
  R = c(rep(1, 11), 2),
  pdf = ge_pdf, cdf = ge_cdf, qdf = ge_qdf,
  par = c(1.5, 0.8)
)

fit <- mle_impadapt2_censor(
  data = samp, pdf = ge_pdf, cdf = ge_cdf,
  start = c(1.0, 1.0), eval_time = 0.5
)
summary(fit)

Maximum Product of Spacings Estimation under Improved Adaptive Type-II Progressive Censoring Scheme

Description

Fits a probability distribution to Improved Adaptive Type-II Progressive Censored (IAT-II PCS) data using Maximum Product of Spacings Estimation (MPSE).

Usage

mpse_impadapt2_censor(
  data,
  n = NULL,
  m = NULL,
  T1 = NULL,
  T2 = NULL,
  R = NULL,
  cdf = NULL,
  pdf = NULL,
  start = NULL,
  lower = NULL,
  upper = NULL,
  method = "BFGS",
  conf_level = 0.95,
  eval_time = NULL,
  ...
)

Arguments

data

Numeric vector of observed failure times, or an object of class "impadapt2_sample".

n

Integer, total number of units placed on test. Required if data is a numeric vector.

m

Integer, pre-fixed target number of failures. Required if data is a numeric vector.

T1

Numeric, first threshold time point T1. Required if data is a numeric vector.

T2

Numeric or NULL, second threshold time point T2 (T2 > T1). Required if data is a numeric vector.

R

Numeric vector of length m, pre-fixed progressive censoring scheme. Required if data is a numeric vector.

cdf

Function (optional), user-supplied cumulative distribution function cdf(x, par).

pdf

Function (optional), user-supplied probability density function pdf(x, par) for hazard rate evaluation.

start

Numeric vector of initial parameter guesses.

lower

Optional numeric vector of lower parameter bounds.

upper

Optional numeric vector of upper parameter bounds.

method

Character string specifying optimization method: "BFGS", "NR", "Nelder-Mead", "CG", "L-BFGS-B", or "SANN". Default is "BFGS".

conf_level

Numeric, confidence level for asymptotic confidence intervals (default 0.95).

eval_time

Optional numeric, time point t > 0 for calculating reliability S(t) and hazard rate h(t).

...

Further arguments passed to optimization routines.

Value

An object of class "impadapt2_mpse" containing:

par

MPSE parameter estimates.

std_er

Standard errors of parameter estimates.

vcov

Variance-covariance matrix.

log_ps

Log product-of-spacings value at MPSE.

confint

Matrix of asymptotic confidence intervals for parameters.

rel_est

Point estimate, SE, and ACI of Reliability function S(t) if eval_time is provided.

haz_est

Point estimate, SE, and ACI of Hazard rate function h(t) if eval_time is provided.

case

Realized censoring scenario ("Case I", "Case II", or "Case III").

method

Optimization routine used.

convergence

Convergence code (0 = successful convergence).

References

Dev, S. S., & Chacko, M. (2026). Statistical inference for generalized exponential distribution under improved adaptive Type-II progressive censoring. Journal of the Iranian Statistical Society, 25(2), 1-29. DOI: 10.22034/jirss.2026.2077492.1165.

Cheng, R. C. H., & Amin, N. A. K. (1983). Estimating parameters in continuous univariate distributions with a shifted origin. Journal of the Royal Statistical Society: Series B (Methodological), 45(3), 394-403.

Examples

set.seed(123)
ge_cdf <- function(x, par) (1 - exp(-par[2] * x))^par[1]
ge_pdf <- function(x, par) par[1] * par[2] * exp(-par[2] * x) * (1 - exp(-par[2] * x))^(par[1] - 1)
ge_qdf <- function(p, par) - (1 / par[2]) * log(1 - p^(1 / par[1]))

samp <- r_impadapt2_censor(
  n = 25, m = 12, T1 = 0.8, T2 = 2.0,
  R = c(rep(1, 11), 2),
  pdf = ge_pdf, cdf = ge_cdf, qdf = ge_qdf,
  par = c(1.5, 0.8)
)

fit <- mpse_impadapt2_censor(
  data = samp, cdf = ge_cdf, pdf = ge_pdf,
  start = c(1.0, 1.0), eval_time = 0.5
)
summary(fit)

Diagnostic Visualizations for Improved Adaptive Type-II Progressive Censoring

Description

Generates diagnostic graphics (histogram, dot plot, empirical vs fitted survival curves, MCMC trace and autocorrelation plots).

Usage

plot_impadapt2_sample(x, ...)

Arguments

x

An object of class "impadapt2_sample", "impadapt2_mle", "impadapt2_mpse", or "impadapt2_bayes".

...

Additional graphical arguments.

Value

No return value, called for side effects (plotting).

Examples

set.seed(123)
ge_cdf <- function(x, par) (1 - exp(-par[2] * x))^par[1]
ge_pdf <- function(x, par) par[1] * par[2] * exp(-par[2] * x) * (1 - exp(-par[2] * x))^(par[1] - 1)
ge_qdf <- function(p, par) - (1 / par[2]) * log(1 - p^(1 / par[1]))

samp <- r_impadapt2_censor(
  n = 20, m = 10, T1 = 0.8, T2 = 2.0,
  R = c(rep(1, 10)),
  pdf = ge_pdf, cdf = ge_cdf, qdf = ge_qdf,
  par = c(1.5, 0.8)
)
plot(samp)

Data Generation under Improved Adaptive Type-II Progressive Censoring Scheme

Description

Generates random censored lifetime data under the Improved Adaptive Type-II Progressive Censoring Scheme (IAT-II PCS) as described by Dev and Chacko (2026) and Yan et al. (2021).

Usage

r_impadapt2_censor(
  n,
  m,
  T1,
  T2 = NULL,
  R,
  pdf = NULL,
  cdf = NULL,
  qdf = NULL,
  par = NULL,
  seed = NULL,
  lower = 1e-07,
  upper = 100000
)

Arguments

n

Integer, total number of units placed on test (n >= 1).

m

Integer, pre-fixed target number of failures (1 <= m <= n).

T1

Numeric, first pre-fixed threshold time point (T1 > 0).

T2

Numeric or NULL, second pre-fixed threshold time point (T2 > T1). If NULL, defaults to Inf.

R

Numeric vector of length m, pre-fixed progressive censoring scheme satisfying sum(R) + m = n.

pdf

Function (optional), user-supplied probability density function pdf(x, par).

cdf

Function (optional), user-supplied cumulative distribution function cdf(x, par).

qdf

Function (optional), user-supplied quantile function qdf(p, par).

par

Numeric vector, true parameter values for the specified distribution.

seed

Optional integer, seed for random number generation.

lower

Numeric, lower bound for numerical quantile root finding (default 1e-7).

upper

Numeric, upper bound for numerical quantile root finding (default 1e5).

Value

An object of class "impadapt2_sample" containing:

data

Numeric vector of observed failure times up to test termination.

case

Character string indicating the realized censoring case ("Case I", "Case II", or "Case III").

d1

Number of failures observed at or before threshold time T1.

d2

Number of failures observed at or before threshold time T2.

D1

Value of D1 parameter for likelihood construction.

D2

Value of D2 parameter (total observed failures) for likelihood construction.

R_effective

Numeric vector of effective progressive censoring plan applied.

R_star

Number of remaining live units removed at experiment termination time T_star.

T_star

Terminal time of the experiment (X_m for Cases I and II; T2 for Case III).

T1

Threshold time T1.

T2

Threshold time T2.

n

Total sample size.

m

Target failure count.

R_initial

Initial pre-fixed progressive censoring plan.

par

True parameter values.

References

Dev, S. S., & Chacko, M. (2026). Statistical inference for generalized exponential distribution under improved adaptive Type-II progressive censoring. Journal of the Iranian Statistical Society, 25(2), 1-29. DOI: 10.22034/jirss.2026.2077492.1165.

Yan, L., Zhang, Q., & Dong, A. (2021). Inference for the Burr XII distribution based on improved adaptive progressive Type-II censoring. Journal of Computational and Applied Mathematics, 381, 113022. DOI: 10.1016/j.cam.2020.113022.

Balakrishnan, N., & Sandhu, R. (1995). A simple simulational algorithm for generating progressively Type-II censored samples. The American Statistician, 49(2), 229-230.

Examples

set.seed(123)
ge_cdf <- function(x, par) (1 - exp(-par[2] * x))^par[1]
ge_pdf <- function(x, par) par[1] * par[2] * exp(-par[2] * x) * (1 - exp(-par[2] * x))^(par[1] - 1)
ge_qdf <- function(p, par) - (1 / par[2]) * log(1 - p^(1 / par[1]))

res <- r_impadapt2_censor(
  n = 20, m = 10, T1 = 0.8, T2 = 2.0,
  R = c(rep(1, 10)),
  pdf = ge_pdf, cdf = ge_cdf, qdf = ge_qdf,
  par = c(1.5, 0.8)
)
print(res)