ngrad_mat_func: Gradient Matrix of Negative Log-Likelihood Function for...

View source: R/nll_ngrad_nhess_functions.R

ngrad_mat_funcR Documentation

Gradient Matrix of Negative Log-Likelihood Function for Illness-Death Model

Description

Function returning a matrix of contributions to the gradient of the negative log-likelihood for the illness-death model, under specified baseline hazard, and specified frailty, and specified Markov/semi-Markov transition assumption. Typically, this function will not be used directly by the user, but as part of a larger estimation procedure.

Usage

ngrad_mat_func(
  para,
  y1,
  y2,
  delta1,
  delta2,
  Xmat1,
  Xmat2,
  Xmat3,
  hazard,
  frailty,
  model
)

Arguments

para

A numeric vector of parameters, arranged as follows: the first k_1+k_2+k_3 elements correspond to the baseline hazard parameters, then the k_1+k_2+k_3+1 element corresponds to the gamma frailty log-variance parameter, then the lastq_1+q_2+q_3 elements correspond with the regression parameters.

y1, y2

Numeric vectors of length n with (possibly censored) non-terminal and terminal event times

delta1, delta2

Numeric vectors of length n with indicators of 1 if the event was observed and 0 otherwise

Xmat1, Xmat2, Xmat3

Numeric matrices with n rows and q_1,q_2,q_3 columns containing covariates.

hazard

String specifying the form of the baseline hazard.

frailty

Boolean indicating whether a gamma distributed subject-specific frailty should be included. Currently this must be set to TRUE.

model

String specifying the transition assumption

Value

Returns numeric matrix with n rows and width same as length of para with gradient contributions for the negative log likelihood.


hreed7/SemiCompRisksPen documentation built on Dec. 15, 2024, 5:41 p.m.