Build initial values from a compiled model spec
build_inits_from_spec.RdProduces 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).
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.
Details
Notes:
Uses only
componentsas the model size parameter.SB: initializes stick breaks
v; weightsware deterministic.CRP: initializes memberships
zin1:components.Link-mode parameters initialize regression coefficients
beta_<param>with shapecomponents x P.Default GPD threshold under X is stochastic lognormal: initializes
threshold[1:N]and scalarsdlog_u(non-link thresholds are scalar).