setup_run_tmb: Set up and run TMB

Description Usage Arguments

View source: R/model_functions.R

Description

Generic TMB model run handler. Sets up the ADFun object, applies model speedups and fixes as specified, and optimizes using 'nlminb'. This is meant to be a helper function run by more specific model functions.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
setup_run_tmb(
  tmb_data_stack,
  params_list,
  tmb_random,
  tmb_map,
  tmb_outer_maxsteps,
  tmb_inner_maxsteps,
  normalize = FALSE,
  run_symbolic_analysis = FALSE,
  set_limits = FALSE,
  limit_max = 10,
  limit_min = -limit_max,
  parallel_model = FALSE,
  optimization_method = "nlminb",
  model_name = "model",
  verbose = FALSE,
  inner_verbose = FALSE
)

Arguments

tmb_data_stack

List containing all data inputs expected in the TMB CPP file

params_list

List containing all parameters expected in the TMB CPP file

tmb_random

Character vector containing all random effects that will be optimized in the inner optimizer

tmb_map

Named list containing parameters that will be treated in a particular way by the optimizer

tmb_outer_maxsteps

Max number of steps taken by the outer optimizer

tmb_inner_maxsteps

Max number of steps taken by the inner optimizer in a single outer optimizer step

normalize

[boolean, default FALSE] Run TMB's automatic process normalization function? Adds two additional items to the TMB data stack: 'auto_normalize' (1) and 'early_return' (0). Both are used by the normalize_adfun function to get the normalizing constant prior to optimization. For more details, see


njhenry/covidemr documentation built on Feb. 2, 2022, 2:31 a.m.