% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/decomposition.R
\name{hzr_decompos_g3}
\alias{hzr_decompos_g3}
\title{Late-phase (G3) temporal decomposition}
\usage{
hzr_decompos_g3(time, tau, gamma, alpha, eta)
}
\arguments{
\item{time}{Numeric vector of times (must be > 0).}

\item{tau}{Positive scalar scale parameter.}

\item{gamma}{Positive scalar time exponent.}

\item{alpha}{Non-negative scalar shape parameter (0 selects limiting case).}

\item{eta}{Positive scalar outer exponent.}
}
\value{
A named list with two numeric vectors, each the same length
as \code{time}:
\describe{
\item{G3}{Cumulative intensity \eqn{G_3(t) \ge 0} (may exceed 1).}
\item{g3}{Derivative \eqn{g_3(t) = dG_3/dt \ge 0}.}
}
}
\description{
Computes the cumulative intensity \eqn{G_3(t)} and its derivative
\eqn{g_3(t) = dG_3/dt} for the late-phase parametric family used in the
original Blackstone C/SAS HAZARD code.  Unlike \code{\link[=hzr_decompos]{hzr_decompos()}} (which
computes the early-phase G1 -- a bounded CDF), this function can produce
\strong{unbounded} values, making it suitable for modelling increasing late risk.
}
\section{Mathematical form}{


When \eqn{\alpha > 0}:
\deqn{G_3(t) = \bigl(\bigl((t/\tau)^\gamma + 1\bigr)^{1/\alpha}
                      - 1\bigr)^\eta}

When \eqn{\alpha = 0} (limiting exponential case):
\deqn{G_3(t) = \bigl(\exp\bigl((t/\tau)^\gamma\bigr) - 1\bigr)^\eta}
}

\section{Parameter mapping from SAS/C HAZARD}{
\tabular{lll}{
   SAS name \tab R argument \tab Role \cr
   TAU \tab \code{tau} \tab Scale (time at which \eqn{(t/\tau) = 1}) \cr
   GAMMA \tab \code{gamma} \tab Power exponent on \eqn{t/\tau} \cr
   ALPHA \tab \code{alpha} \tab Shape (0 = exponential limiting case) \cr
   ETA \tab \code{eta} \tab Outer power exponent \cr
}
}

\examples{
t_grid <- seq(0.1, 10, by = 0.1)

# Weibull-like: alpha = 1 gives G3(t) = (t/tau)^(gamma*eta)
d <- hzr_decompos_g3(t_grid, tau = 1, gamma = 3, alpha = 1, eta = 1)
plot(t_grid, d$G3, type = "l", main = "G3: power law (gamma=3)")

# General case with alpha > 0
d2 <- hzr_decompos_g3(t_grid, tau = 2, gamma = 2, alpha = 0.5, eta = 1)

}
\references{
Blackstone EH, Naftel DC, Turner ME Jr. The decomposition of time-varying
hazard into phases, each incorporating a separate stream of concomitant
information. \emph{J Am Stat Assoc.} 1986;81(395):615--624.
\doi{10.1080/01621459.1986.10478314}
}
\seealso{
\code{\link[=hzr_decompos]{hzr_decompos()}} for the early-phase (G1) decomposition,
\code{\link[=hzr_phase_cumhaz]{hzr_phase_cumhaz()}} for phase-level cumulative hazard helpers.
}
