nhess_func: Hessian of Negative Log-Likelihood Function for Illness-Death...

View source: R/nll_ngrad_nhess_functions.R

nhess_funcR Documentation

Hessian of Negative Log-Likelihood Function for Illness-Death Model

Description

Function returning the Hessian 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

nhess_func(
  para,
  y1,
  y2,
  delta1,
  delta2,
  Xmat1,
  Xmat2,
  Xmat3,
  frailty,
  hazard,
  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.

frailty

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

hazard

String specifying the form of the baseline hazard.

model

String specifying the transition assumption

Value

Returns numeric square matrix with dimensions the same length as para with sum of gradient contributions for the negative log likelihood.


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