safe_rtmb_model: Safe RTMB model construction (with error message translation)

safe_rtmb_modelR Documentation

Safe RTMB model construction (with error message translation)

Description

Wraps 'rtmb_model' to translate cryptic error messages generated during 'MakeADFun' execution (originating from C++/RTMB) into user-friendly hints.

Usage

safe_rtmb_model(data, code, par_names = list(), init = NULL, view = NULL)

Arguments

data

A list of data that has passed 'validate_data'.

code

Code blocks for likelihood and priors defined with 'model_code()'.

par_names

A list of variable names corresponding to the dimensions of each parameter (optional).

init

A list or numeric vector of initial values (optional).

view

Character vector of parameter names to be displayed preferentially in summary outputs (optional).

Value

Returns an 'rtmb_model' object (R6 class instance) upon successful compilation.


BayesRTMB documentation built on Nov. 24, 2026, 9:06 a.m.