% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/cox_helpers.R
\name{info_cox}
\alias{info_cox}
\title{Compute Cox Observed Information Matrix}
\usage{
info_cox(X, eta, status, y = NULL, weights = 1)
}
\arguments{
\item{X}{Design matrix (N x p), sorted by ascending event time.}

\item{eta}{Linear predictor vector.}

\item{status}{Event indicator (1 = event, 0 = censored).}

\item{y}{Optional numeric vector of observed event/censor times, same length
and order as \code{eta}. When supplied, tied event times are handled with
the Breslow approximation. When omitted, the function assumes there are no
ties.}

\item{weights}{Observation weights (default 1).}
}
\value{
Symmetric p x p observed information matrix.
}
\description{
Negative Hessian of the Cox partial log-likelihood under the Breslow
approximation for tied event times. Data must be sorted by ascending event
time.
}
\details{
Under the Breslow approximation, the observed information is
\deqn{\sum_g d_g^{(w)}
  \Bigl[\frac{S_{2g}}{S_{0g}} -
  \Bigl(\frac{S_{1g}}{S_{0g}}\Bigr)
  \Bigl(\frac{S_{1g}}{S_{0g}}\Bigr)^{\top}\Bigr]}
where
\eqn{S_{0g} = \sum_{j \in R_g} w_j e^{\eta_j}},
\eqn{S_{1g} = \sum_{j \in R_g} w_j e^{\eta_j}\mathbf{x}_j},
and \eqn{S_{2g} = \sum_{j \in R_g} w_j e^{\eta_j}\mathbf{x}_j\mathbf{x}_j^{\top}}.
}
\keyword{internal}
