% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/importance_sampling.R
\name{is_adapt1_phcs}
\alias{is_adapt1_phcs}
\title{Importance Sampling Estimation under Adaptive Type-I PHCS}
\usage{
is_adapt1_phcs(
  data,
  n,
  m,
  T_thresh,
  R,
  pdf,
  cdf = NULL,
  surf = NULL,
  prior = NULL,
  start,
  proposal_cov = NULL,
  N_samples = 5000,
  lower = NULL,
  upper = NULL
)
}
\arguments{
\item{data}{Numeric vector of observed failure times.}

\item{n}{Integer, total initial sample size placed on test.}

\item{m}{Integer, pre-fixed target number of failures.}

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

\item{R}{Numeric vector of length m, progressive censoring scheme.}

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

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

\item{surf}{Function (optional), user-supplied survival function surf(x, par).}

\item{prior}{Function (optional), user-supplied prior density function log_prior(par).}

\item{start}{Numeric vector, center for proposal distribution (e.g., MLE or initial guess).}

\item{proposal_cov}{Matrix (optional), covariance matrix for Gaussian proposal distribution.}

\item{N_samples}{Integer, number of importance samples (default 5000).}

\item{lower}{Numeric vector (optional), lower parameter bounds.}

\item{upper}{Numeric vector (optional), upper parameter bounds.}
}
\value{
A list containing estimated posterior mean, standard error, effective sample size (ESS), and importance weights.
}
\description{
Estimates parameters and posterior expectations via Importance Sampling under Adaptive Type-I PHCS.
}
\examples{
set.seed(123)
my_cdf <- function(x, par) pexp(x, rate = par[1])
my_pdf <- function(x, par) dexp(x, rate = par[1])
my_surf <- function(x, par) 1 - pexp(x, rate = par[1])
flat_prior <- function(par) ifelse(par[1] > 0, 0, -Inf)
R_plan <- c(rep(1, 8), rep(0, 4))
dat <- r_adapt1_phcs(
  n = 20, m = 12, T_thresh = 2.5,
  R = R_plan, pdf = my_pdf,
  cdf = my_cdf, par = 0.5
)$data
is_res <- is_adapt1_phcs(
  data = dat, n = 20, m = 12,
  T_thresh = 2.5, R = R_plan,
  pdf = my_pdf, cdf = my_cdf,
  surf = my_surf, prior = flat_prior,
  start = c(rate = 0.5), N_samples = 1000
)
print(is_res$summary)
}
