joint_ms_start_val {VAJointSurv} | R Documentation |
Quick Heuristic for the Starting Values
Description
Quick Heuristic for the Starting Values
Usage
joint_ms_start_val(
object,
par = object$start_val,
rel_eps = 1e-08,
max_it = 1000L,
n_threads = object$max_threads,
c1 = 1e-04,
c2 = 0.9,
use_bfgs = TRUE,
trace = 0,
cg_tol = 0.5,
strong_wolfe = TRUE,
max_cg = 0,
pre_method = 3L,
quad_rule = object$quad_rule,
mask = integer(),
cache_expansions = object$cache_expansions,
gr_tol = -1,
gh_quad_rule = object$gh_quad_rule
)
Arguments
object |
a joint_ms object from |
par |
starting value. |
rel_eps , max_it , c1 , c2 , use_bfgs , trace , cg_tol , strong_wolfe , max_cg , pre_method , mask , gr_tol |
arguments to pass to the C++ version of |
n_threads |
number of threads to use. This is not supported on Windows. |
quad_rule |
list with nodes and weights for a quadrature rule for the integral from zero to one. |
cache_expansions |
|
gh_quad_rule |
list with two numeric vectors called node and weight
with Gauss–Hermite quadrature nodes and weights to handle delayed entry.
A low number of quadrature nodes and weights is used when |
Value
Numeric vector of starting values for the model parameters.
Examples
# load in the data
library(survival)
data(pbc, package = "survival")
# re-scale by year
pbcseq <- transform(pbcseq, day_use = day / 365.25)
pbc <- transform(pbc, time_use = time / 365.25)
# create the marker terms
m1 <- marker_term(
log(bili) ~ 1, id = id, data = pbcseq,
time_fixef = bs_term(day_use, df = 5L),
time_rng = poly_term(day_use, degree = 1L, raw = TRUE, intercept = TRUE))
m2 <- marker_term(
albumin ~ 1, id = id, data = pbcseq,
time_fixef = bs_term(day_use, df = 5L),
time_rng = poly_term(day_use, degree = 1L, raw = TRUE, intercept = TRUE))
# base knots on observed event times
bs_term_knots <-
with(pbc, quantile(time_use[status == 2], probs = seq(0, 1, by = .2)))
boundary <- c(bs_term_knots[ c(1, length(bs_term_knots))])
interior <- c(bs_term_knots[-c(1, length(bs_term_knots))])
# create the survival term
s_term <- surv_term(
Surv(time_use, status == 2) ~ 1, id = id, data = pbc,
time_fixef = bs_term(time_use, Boundary.knots = boundary, knots = interior))
# create the C++ object to do the fitting
model_ptr <- joint_ms_ptr(
markers = list(m1, m2), survival_terms = s_term,
max_threads = 2L, ders = list(0L, c(0L, -1L)))
# find the starting values
start_vals <- joint_ms_start_val(model_ptr)