% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/inference.R
\name{ci_cloglog}
\alias{ci_cloglog}
\title{Pointwise Confidence Intervals via Complementary Log-Log Transformation}
\usage{
ci_cloglog(point, se, level = 0.95)
}
\arguments{
\item{point}{Numeric vector of point estimates in (0, 1), length T.}

\item{se}{Numeric vector of bootstrap standard errors of \code{point}
on the probability scale, same length as \code{point} (i.e.
\code{apply(boot_matrix, 1, sd, na.rm = TRUE)}).}

\item{level}{Confidence level. Default 0.95.}
}
\value{
A list with elements \code{ll} and \code{ul}: numeric vectors
  of lower and upper confidence limits, the same length as
  \code{point}.
}
\description{
Computes pointwise confidence intervals for a transition probability
estimate using the cloglog transformation \eqn{g(p) = \log(-\log p)}
with a delta-method standard error scaling. The bootstrap is run on the 
original probability scale; the cloglog SE is then derived analytically.
}
\details{
By the delta method,
\eqn{\mathrm{SE}(g(\hat P)) = \mathrm{SE}(\hat P) / |\hat P \log \hat P|}
(here \eqn{|g'(p)| = 1/|p \log p|} on (0,1)). The interval is built
symmetrically on the cloglog scale and back-transformed via
\eqn{p = \exp(-\exp(\cdot))}. Because \eqn{g} is monotone
decreasing on (0, 1), the upper end on the cloglog scale becomes
the \emph{lower} end on the probability scale, and vice versa.

For point estimates exactly equal to 0 or 1 the cloglog is
undefined and \code{NA} is returned at those positions.
}
