% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/build-run.R
\name{build_monitors_from_spec}
\alias{build_monitors_from_spec}
\title{Build default monitors from a compiled model spec}
\usage{
build_monitors_from_spec(spec, monitor_v = FALSE, monitor_latent = FALSE)
}
\arguments{
\item{spec}{A compiled model specification produced by \code{compile_model_spec()}.}

\item{monitor_v}{Logical; for SB, whether to also monitor stick breaks \code{v}.}

\item{monitor_latent}{Logical; whether to monitor latent cluster labels \code{z}.}
}
\value{
Character vector of node names to monitor.
}
\description{
Returns the character vector of node names to monitor in MCMC.
This is a pre-run builder used by \code{build_nimble_bundle()}.
}
\details{
Monitoring follows these rules:
\itemize{
\item Always monitor concentration \code{kappa} (whether fixed or stochastic).
\item SB: monitor \code{w[1:components]} and optionally \code{v[1:(components-1)]}.
\item CRP: monitor \code{z[1:N]}.
\item Bulk parameters:
\itemize{
\item dist/fixed: monitor \code{<param>[1:components]}
\item link: monitor \code{beta_<param>[1:components, 1:P]}
}
\item GPD (if enabled):
\itemize{
\item threshold: monitor scalar \code{threshold} when not link-mode; \code{threshold[1:N]} for link-mode
\item if threshold is link-mode: monitor \code{beta_threshold[1:P]}
\item if threshold uses LN link-dist default: monitor \code{sdlog_u}
\item tail_scale: if link-mode, monitor \code{beta_tail_scale[1:P]}
\item tail_shape: monitor scalar \code{tail_shape} (fixed or dist)
}
}
}
\keyword{internal}
