% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/cox_helpers.R
\name{unconstrained_fit_cox}
\alias{unconstrained_fit_cox}
\title{Unconstrained Cox PH Estimation for lgspline}
\usage{
unconstrained_fit_cox(
  X,
  y,
  LambdaHalf,
  Lambda,
  keep_weighted_Lambda,
  family,
  tol = 1e-08,
  K,
  parallel,
  cl,
  chunk_size,
  num_chunks,
  rem_chunks,
  order_indices,
  weights,
  status
)
}
\arguments{
\item{X}{Design matrix (N_k x p) for partition k.}

\item{y}{Survival times for partition k.}

\item{LambdaHalf}{Square root of penalty matrix (unused here, retained
for interface compatibility).}

\item{Lambda}{Penalty matrix.}

\item{keep_weighted_Lambda}{Logical; if TRUE, return hot-start estimates
without refinement (not recommended for Cox).}

\item{family}{Cox family object.}

\item{tol}{Convergence tolerance.}

\item{K}{Number of knots.}

\item{parallel}{Logical for parallel processing.}

\item{cl}{Cluster object.}

\item{chunk_size, }{num_chunks, rem_chunks Parallelism parameters.}

\item{order_indices}{Observation indices mapping partition to full data.}

\item{weights}{Observation weights.}

\item{status}{Event indicator (1 = event, 0 = censored), full-data length.}
}
\value{
Numeric column vector of penalized partial-likelihood coefficient
  estimates.
}
\description{
Estimates penalized Cox PH coefficients for a single partition (or the
full model when K = 0) using damped Newton-Raphson on the penalized
partial log-likelihood with the Breslow approximation for tied event times.

This function is passed to lgspline's \code{unconstrained_fit_fxn}
argument. It receives the partition-level design matrix and response,
sorts internally by event time, and returns the coefficient vector.
}
\details{
The penalized partial log-likelihood is
\deqn{\ell_p(\boldsymbol{\beta}) = \ell(\boldsymbol{\beta})
  - \tfrac{1}{2}\boldsymbol{\beta}^{\top}
  \boldsymbol{\Lambda}\boldsymbol{\beta}}
Newton-Raphson updates use the Cox score and observed information
(computed via \code{score_cox} and \code{info_cox}), plus the penalty
term. The step is damped: the step size is halved until the penalized
log-likelihood improves.
}
\examples{
## Used internally by lgspline; see the full-model example below.

}
\keyword{internal}
