% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/cox_helpers.R
\name{cox_qp_score_function}
\alias{cox_qp_score_function}
\title{Cox PH Score Function for Quadratic Programming and Blockfit}
\usage{
cox_qp_score_function(
  X,
  y,
  mu,
  order_list,
  dispersion,
  VhalfInv,
  observation_weights,
  status
)
}
\arguments{
\item{X}{Block-diagonal design matrix (N x P).}

\item{y}{Response vector (survival times, N x 1).}

\item{mu}{Predicted values (N x 1), same order as X and y.}

\item{order_list}{List of observation indices per partition.}

\item{dispersion}{Dispersion (fixed at 1).}

\item{VhalfInv}{Inverse square root correlation matrix (NULL for
independent observations).}

\item{observation_weights}{Observation weights.}

\item{status}{Event indicator (1 = event, 0 = censored).}
}
\value{
Numeric column vector of length P (gradient w.r.t. coefficients).
}
\description{
Computes the score (gradient of partial log-likelihood) in the format
expected by lgspline's \code{qp_score_function} interface. The block-
diagonal design matrix \eqn{\mathbf{X}} and response \eqn{\mathbf{y}} are
in partition order; this function internally sorts by event time, computes
the Cox score using the Breslow approximation for tied event times, and
returns the result in the original partition order.
}
