% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/data_generation.R
\name{r_adapt1_phcs}
\alias{r_adapt1_phcs}
\title{Random Data Generation under Adaptive Type-I Progressive Hybrid Censoring Scheme}
\usage{
r_adapt1_phcs(
  n,
  m,
  T_thresh,
  R,
  pdf = NULL,
  cdf = NULL,
  qdf = NULL,
  par = NULL,
  seed = NULL,
  lower = 1e-07,
  upper = 1e+05
)
}
\arguments{
\item{n}{Integer, total number of units placed on test.}

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

\item{T_thresh}{Numeric, pre-fixed time threshold parameter T > 0.}

\item{R}{Numeric vector of length m, progressive censoring scheme satisfying sum(R) + m = n.}

\item{pdf}{Function, user-supplied probability density function pdf(x, par).}

\item{cdf}{Function, user-supplied cumulative distribution function cdf(x, par).}

\item{qdf}{Function (optional), user-supplied quantile function qdf(p, par).}

\item{par}{Numeric vector, true parameter values for the lifetime distribution.}

\item{seed}{Optional integer, seed for random number generation.}

\item{lower}{Numeric, lower bound for numerical root finding (default 1e-7).}

\item{upper}{Numeric, upper bound for numerical root finding (default 1e5).}
}
\value{
A list containing:
\item{data}{Numeric vector of observed failure times up to test termination.}
\item{censored_at_T}{Logical indicator or count of units censored at time T.}
\item{T_thresh}{The time threshold T.}
\item{n}{Total sample size.}
\item{m}{Target number of failures.}
\item{R_effective}{Effective progressive censoring plan applied.}
\item{d}{Total number of failures observed.}
\item{scheme}{String descriptor of the censoring scheme.}
}
\description{
Generates random censored lifetimes under the Adaptive Type-I Progressive Hybrid Censoring Scheme
as described by Lin and Huang (2012).
}
\examples{
# Example: Standard Exponential distribution
set.seed(123)
my_cdf <- function(x, par) pexp(x, rate = par[1])
my_pdf <- function(x, par) dexp(x, rate = par[1])
my_qdf <- function(p, par) qexp(p, rate = par[1])
R_plan <- c(rep(1, 8), rep(0, 4))
res <- r_adapt1_phcs(
  n = 20, m = 12, T_thresh = 2.5,
  R = R_plan, pdf = my_pdf,
  cdf = my_cdf, qdf = my_qdf, par = 0.5
)
print(res$data)
}
\references{
Lin, C. T., & Huang, Y. L. (2012). On adaptive Type-I progressive hybrid censored samples.
\emph{Journal of Statistical Computation and Simulation}, 82(7), 1005-1018.

Balakrishnan, N., Cramer, E., & Kundu, D. (2023). \emph{Hybrid censoring know-how: Designs and implementations}. Academic Press.
}
