Skip to contents

Produces a list of initial values suitable for passing to nimbleModel. The initial values are derived from spec$plan and are intended to be stable and support-respecting (e.g., positive parameters start positive).

Usage

build_inits_from_spec(spec, seed = NULL, y = NULL, X = NULL)

Arguments

spec

A compiled model specification produced by compile_model_spec().

seed

Optional seed (single integer or vector). If provided, the first element is used.

y

Optional numeric vector of observed outcomes used for heuristic initializations.

X

Optional numeric matrix of covariates used for link-mode parameter initializations.

Value

Named list of initial values.

Details

Notes:

  • Uses only components as the model size parameter.

  • SB: initializes stick breaks v; weights w are deterministic.

  • CRP: initializes memberships z in 1:components.

  • Link-mode parameters initialize regression coefficients beta_<param> with shape components x P.

  • Default GPD threshold under X is stochastic lognormal: initializes threshold[1:N] and scalar sdlog_u (non-link thresholds are scalar).