LikGradHess.general {flexmsm}R Documentation

Likelihood, gradient and Hessian for univariate transition intensity based models

Description

Likelihood, gradient and Hessian for univariate transition intensity based models

Usage

LikGradHess.general(
  params,
  data = NULL,
  full.X = NULL,
  MM,
  pen.matr.S.lambda,
  aggregated.provided = FALSE,
  do.gradient = TRUE,
  do.hessian = TRUE,
  pmethod = "analytic",
  death,
  Qmatr.diagnostics.list = NULL,
  verbose = FALSE,
  parallel = FALSE,
  no_cores = 2
)

Arguments

params

Parameters vector.

data

Dataset in proper format.

full.X

Full design matrix.

MM

List of necessary setup quantities.

pen.matr.S.lambda

Penalty matrix multiplied by smoothing parameter lambda.

aggregated.provided

Whether aggregated form was provided (may become obsolete in the future if we see original dataset as special case of aggregated where nrep = 1).

do.gradient

Whether or not to compute the gradient.

do.hessian

Whether or not to compute the Hessian.

pmethod

Method to be used for computation of transition probability matrix. See help of msm() for further details.

death

Whether the last state is an absorbing state.

Qmatr.diagnostics.list

List of maximum absolute values of the Q matrices computed during model fitting.

verbose

Whether to print out the progress being made in computing the likelihood, gradient and Hessian.

parallel

Whether or not to use parallel computing (only for Windows users for now).

no_cores

Number of cores used if parallel computing chosen. The default is 2. If NULL, all available cores are used.

Value

Penalized likelihood, gradient and Hessian associated with model at given parameters, for use by trust region algorithm.


[Package flexmsm version 0.1.1 Index]