Skip to contents

Returns the character vector of node names to monitor in MCMC. This is a pre-run builder used by build_nimble_bundle().

Usage

build_monitors_from_spec(spec, monitor_v = FALSE, monitor_latent = FALSE)

Arguments

spec

A compiled model specification produced by compile_model_spec().

monitor_v

Logical; for SB, whether to also monitor stick breaks v.

monitor_latent

Logical; whether to monitor latent cluster labels z.

Value

Character vector of node names to monitor.

Details

Monitoring follows these rules:

  • Always monitor concentration kappa (whether fixed or stochastic).

  • SB: monitor w[1:components] and optionally v[1:(components-1)].

  • CRP: monitor z[1:N].

  • Bulk parameters:

    • dist/fixed: monitor <param>[1:components]

    • link: monitor beta_<param>[1:components, 1:P]

  • GPD (if enabled):

    • threshold: monitor scalar threshold when not link-mode; threshold[1:N] for link-mode

    • if threshold is link-mode: monitor beta_threshold[1:P]

    • if threshold uses LN link-dist default: monitor sdlog_u

    • tail_scale: if link-mode, monitor beta_tail_scale[1:P]

    • tail_shape: monitor scalar tail_shape (fixed or dist)