Skip to contents

Fit a model for each grid cell defined in grid_parameters where each grid cell has a different combination of fixed parameter values.

Usage

run_grid(
  data,
  grid_parameters,
  bounds = NULL,
  map = list(),
  random = c(),
  control = list(eval.max = 10000L, iter.max = 10000L),
  parallel = FALSE,
  n_passes = 3L,
  start = NULL,
  b0_start_step = NULL,
  b0_start_max = 10,
  verbose = TRUE
)

Arguments

data

A list containing the data created using the get_data function.

grid_parameters

A list of parameter inputs for each grid cell. For current MLE-grid work, create this with make_mle_grid_parameters(). get_grid() is retained for legacy direct-anchor grids.

bounds

Optional list with lower and upper elements defining parameter bounds, created using the get_bounds function. If NULL, bounds are computed separately for each grid cell.

map

A list defining how to optionally collect and fix parameters. Default is an empty list.

random

A character vector defining the random effect parameters. Default is an empty vector.

control

A list of control parameters passed to nlminb. Default is list(eval.max = 10000, iter.max = 10000).

parallel

Retained for backward compatibility. The current implementation runs sequentially regardless of this value.

n_passes

Integer number of repeated nlminb passes per grid cell. Default is 3.

start

Optional numeric starting vector. If supplied, matching named elements are copied to each grid-cell starting vector.

b0_start_step

Optional numeric multiplier used to increase par_log_B0 until the starting objective is finite. If NULL, no B0 start adjustment is made.

b0_start_max

Numeric maximum total B0 start multiplier when b0_start_step is supplied. Default is 10.

verbose

Logical. If TRUE, print progress messages before each grid cell, after each nlminb pass, and after each grid cell finishes.

Value

A named list of fitted, in-memory RTMB objectives, one per cell.

Details

This is the current deterministic MLE-grid engine. Summarise its results with summarise_mle_grid() and require validate_mle_grid_state_records() to pass before fitted states are used downstream. For posterior sampling within every grid cell, including resumable on-disk checkpoints, use run_grid_mcmc().