update_inits: Update initial values for model fitting

View source: R/model-tools.R

update_initsR Documentation

Update initial values for model fitting

Description

This function updates the initial values for model fitting based on the specified initialization method.

Usage

update_inits(
  data,
  model,
  init,
  init_method = c("prior", "pathfinder"),
  init_method_args = list(),
  ...
)

Arguments

data

A list of data as produced by model modules (for example enw_expectation(), enw_obs(), etc.) and as required for use the model being used.

model

A cmdstanr model object as loaded by enw_model() or as supplied by the user.

init

A list of initial values or a function to generate initial values. If not provided, the model will attempt to generate initial values

init_method

The method to use for initializing the model. Defaults to "prior" which samples initial values from the prior. "pathfinder", which uses the pathfinder algorithm (enw_pathfinder()) to initialize the model.

init_method_args

A list of additional arguments to pass to the initialization method.

...

Additional arguments passed to initialization methods.

Value

A list containing updated initial values and method-specific output.


seabbs/epinowcast documentation built on Sept. 20, 2024, 2:39 a.m.