\name{bayes_impadapt2_censor}
\alias{bayes_impadapt2_censor}
\title{Bayesian MCMC Estimation under Improved Adaptive Type-II Progressive Censoring Scheme}
\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{
\item{data}{Numeric vector of observed failure times, or an object of class \code{"impadapt2_sample"}.}

\item{n}{Integer, total number of units placed on test. Required if data is a numeric vector.}

\item{m}{Integer, pre-fixed target number of failures. Required if data is a numeric vector.}

\item{T1}{Numeric, first threshold time point T1. Required if data is a numeric vector.}

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

\item{R}{Numeric vector of length m, pre-fixed progressive censoring scheme. Required if data is a numeric vector.}

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

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

\item{start}{Numeric vector of initial parameter values.}

\item{prior_mean}{Optional numeric vector of prior means for parameters.}

\item{prior_sd}{Optional numeric vector of prior standard deviations for parameters.}

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

\item{c_linex}{Numeric, shape parameter c for LINEX loss function (default 1.0).}

\item{n_iter}{Integer, total number of MCMC iterations (default 5000).}

\item{burn_in}{Integer, number of initial burn-in iterations to discard (default 1000).}

\item{thin}{Integer, thinning interval (default 1).}

\item{conf_level}{Numeric, credible level for HPD intervals (default 0.95).}

\item{eval_time}{Optional numeric, time point t > 0 for calculating reliability S(t) and hazard rate h(t).}

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

\item{proposal_sd}{Optional numeric vector of proposal standard deviations for Metropolis-Hastings steps.}
}
\value{
An object of class \code{"impadapt2_bayes"} containing:
\item{bayes_sel}{Bayes point estimates under Squared Error Loss.}
\item{bayes_linex}{Bayes point estimates under LINEX Loss.}
\item{post_sd}{Posterior standard deviations of parameters.}
\item{hpd_interval}{Matrix of Highest Posterior Density (HPD) credible intervals for parameters.}
\item{chain}{Matrix of retained MCMC posterior samples.}
\item{rel_est}{Bayes estimates, SD, and HPD interval for Reliability S(t) if eval_time is provided.}
\item{haz_est}{Bayes estimates, SD, and HPD interval for Hazard rate h(t) if eval_time is provided.}
\item{acceptance_rate}{Acceptance rate of the Metropolis-Hastings MCMC sampler.}
\item{case}{Realized censoring scenario ("Case I", "Case II", or "Case III").}
}
\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.
}
\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)
}
\references{
Dev, S. S., & Chacko, M. (2026). Statistical inference for generalized exponential distribution under improved adaptive Type-II progressive censoring.
\emph{Journal of the Iranian Statistical Society}, 25(2), 1-29. DOI: 10.22034/jirss.2026.2077492.1165.
}
