Lightweight constructor for a tulpa_family object that exposes the
contract required by prior_predict() and tulpa_simulate(). Model
packages (tulpaRatio, tulpaObs) register richer families that also link to
C++ likelihoods; this helper is for tests and simple custom families that
only need simulation.
Usage
tulpa_family(
name,
simulate_fn,
process_names = "y",
extra_params = list(),
link_inv = NULL
)Arguments
- name
Family name (character, length 1).
- simulate_fn
function(eta, params, n_obs, ...)returning a numeric vector of lengthn_obs(single-process) or a list of such vectors keyed byprocess_names(multi-process).etais a list of linear predictors, one per process.- process_names
Character vector. Defaults to
"y"(single-process).- extra_params
Named list of
tulpa_priorobjects for likelihood- specific scalar parameters (e.g., dispersionphi). Drawn at each prior-predictive iteration. Defaults to empty.- link_inv
List of inverse-link functions per process; defaults to identity for every process. tulpa passes the raw linear predictor to
simulate_fn, so most families implement the link insidesimulate_fn(e.g.,mu = exp(eta)for Poisson). Thelink_invslot exists for families that prefer to keep the inverse-link separate.