get_cox_gradient: Compute the Gradient for Cox Proportional Hazards Model

get_cox_gradientR Documentation

Compute the Gradient for Cox Proportional Hazards Model

Description

This function computes the gradient for the Cox proportional hazards model. The gradient is calculated by considering the contributions of each observation to the gradient based on the risk set at each event time.

Usage

get_cox_gradient(X, time, status, coefs, entry_points)

Arguments

X

A matrix of covariates (design matrix) for the Cox model.

time

A numeric vector of event times.

status

A numeric vector of event indicators (1 for event, 0 for censored).

coefs

A numeric vector of coefficients for the Cox model.

entry_points

A numeric vector of entry times for the subjects. Defaults to 0.

Value

A numeric vector representing the gradient of the Cox proportional hazards model.


catalytic documentation built on April 4, 2025, 5:51 a.m.