get_start: Get Starting Parameter Values

View source: R/model_helper_functions.R

get_startR Documentation

Get Starting Parameter Values

Description

A function to generate principled starting values for optimization, based on model specifications.

Usage

get_start(
  y1,
  y2,
  delta1,
  delta2,
  Xmat1,
  Xmat2,
  Xmat3,
  basis1,
  basis2,
  basis3,
  basis3_y1,
  dbasis1,
  dbasis2,
  dbasis3,
  hazard,
  frailty,
  model,
  sparse_start = FALSE
)

Arguments

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.

basis1, basis2, basis3, basis3_y1

Numeric matrices with n rows and k_1,k_2,k_3 columns with piecewise/spline basis function values at the corresponding y1 and y2 values. Under semi-Markov model, basis3 represents basis derived from y_2-y_1 and basis3_y1 is unused, while under Markov model, basis3 represents basis derived from y_2 and basis3_y1 is from y_1 Not used under Weibull model.

dbasis1, dbasis2, dbasis3

Numeric matrices with n rows and k_1,k_2,k_3 columns with piecewise/spline basis function derivative values at the corresponding y1 and y2 values. Used only under Royston-Parmar model.

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

sparse_start

Boolean indicating whether to set all regression parameters to 0 if TRUE, or to pre-estimate them using univariate models if FALSE.

Value

A vector of starting parameter values.


harrisonreeder/SemiCompRisksPen documentation built on Dec. 13, 2024, 5:30 a.m.