% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/predict-cl.R
\name{.hzr_predict_with_se}
\alias{.hzr_predict_with_se}
\title{Compute point predictions + delta-method CLs}
\usage{
.hzr_predict_with_se(
  object,
  type,
  time = NULL,
  x = NULL,
  x_list = NULL,
  cov_counts = NULL,
  phases = NULL,
  level = 0.95,
  diff_fn,
  conf_type = c("log-log", "logit")
)
}
\arguments{
\item{object}{Fitted \code{hazard} object.}

\item{type}{One of "hazard", "linear_predictor", "survival",
"cumulative_hazard".}

\item{time}{Numeric prediction times or NULL (for type = "hazard" /
"linear_predictor").}

\item{x}{Design matrix (single-distribution) or NULL.  Ignored for
multiphase; use \code{x_list} instead.}

\item{x_list}{Named list of per-phase design matrices (multiphase only).}

\item{cov_counts}{Named integer covariate counts (multiphase only).}

\item{phases}{Named list of \code{hzr_phase} objects (multiphase only).}

\item{level}{Confidence level (default 0.95).}

\item{diff_fn}{Required function(theta) -> numeric vector of length n
returning the delta-method target (H, exp(eta), or eta depending on
\code{type}).  Used for the point estimate AND for the numeric jacobian
fallback in exp / loglogistic / lognormal.}

\item{conf_type}{Survival CL transform: \code{"log-log"} (default, on
\verb{log(-log S)}) or \code{"logit"} (on \code{logit(1 - S)}, HAZPRED-compatible).
Only consulted when \code{type == "survival"}.}
}
\value{
data.frame with columns \code{fit}, \code{se.fit}, \code{lower}, \code{upper}.
}
\description{
Dispatched from predict.hazard() when \code{se.fit = TRUE}.
}
\details{
\subsection{DELTA-METHOD TARGET}{

The quantity we actually differentiate depends on the prediction type and
the CL scale the type uses:

type = "cumulative_hazard" -> target = H, log-scale CL
type = "survival"          -> target = H, log-log-survival CL
(final \code{fit} is exp(-H))
type = "hazard"            -> target = exp(eta) (single-dist only),
log-scale CL
type = "linear_predictor"  -> target = eta, natural-scale CL

The caller supplies \code{diff_fn(theta)} that returns the target vector of
length n.  For Weibull and multiphase we build J analytically; for
exp / loglogistic / lognormal we fall through to a numeric jacobian of
\code{diff_fn}.
}
}
\keyword{internal}
