% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/inference.R
\name{confidence_band}
\alias{confidence_band}
\title{Simultaneous Confidence Band via Cluster-Bootstrap Quantile}
\usage{
confidence_band(point, boot, times, level = 0.95, trim = c(0.05, 0.95))
}
\arguments{
\item{point}{Numeric vector of point estimates over a time grid.}

\item{boot}{Numeric matrix of bootstrap replicates of \code{point}
on the original probability scale: rows correspond to time
points (matching \code{point}), columns to bootstrap replicates.}

\item{times}{Numeric vector of times matching the rows of \code{boot}
and the entries of \code{point}.}

\item{level}{Confidence level. Default 0.95.}

\item{trim}{Numeric vector of length 2. Lower and upper quantiles of
the jump-time distribution at which to clip the band (avoids the
"fans out" behavior near the extremes of follow-up). Default
\code{c(0.05, 0.95)}.}
}
\value{
A list with elements \code{ll.band} and \code{ul.band}:
  numeric vectors of band limits, with \code{NA} outside the trimmed
  range or where \code{point} is at the boundary 0/1.
}
\description{
Constructs a simultaneous (uniform-over-time) confidence band for a
transition probability curve. The band is built on the cloglog
scale: for each bootstrap replicate, the standardized supremum
\eqn{\sup_t |g(\hat P_b(t)) - g(\hat P(t))| / \mathrm{SE}_g(t)} is
computed, where \eqn{\mathrm{SE}_g(t)} is the delta-method SE on
the cloglog scale. The \code{level} quantile of those suprema is
the critical value, and the band is back-transformed to the
probability scale.
}
\details{
Only one bootstrap on the original (probability) scale is required:
\eqn{\mathrm{SE}_g(t)} is obtained by the delta method from
\eqn{\mathrm{SE}(\hat P(t)) = \mathrm{sd}(\hat P^*(t))}, and the
cloglog values \eqn{g(\hat P_b(t))} are computed by transforming
the existing replicates pointwise -- no separate cloglog-scale
bootstrap is run.
}
\section{Note}{

This version uses an equal-precision-type band on the cloglog
scale, in which the bootstrap deviation is standardized pointwise
by the delta-method standard error of \eqn{P(t)}. By the self-
cancellation of \eqn{\sqrt{n}} factors, this is asymptotically
equivalent to standardizing the limit process by its asymptotic
standard error on the cloglog scale, which is the standard
equal-precision construction. This construction is asymptotically
valid under conditions C1-C6 of Bakoyannis (2021), but differs
from the Hall-Wellner-type weight proposed in Section 2.3 of that
paper. Both constructions yield asymptotically valid simultaneous
bands. The paper's Hall-Wellner-type construction will be added as
a \code{band_method} option in a future release and will become
the default.
}

\references{
Bakoyannis, G. (2021). Nonparametric analysis of nonhomogeneous
multistate processes with clustered observations.
\emph{Biometrics}, 77(2), 533-546. \doi{10.1111/biom.13327}
}
