% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/internal.R
\name{.truncate_components_one_draw}
\alias{.truncate_components_one_draw}
\title{Truncate and reorder mixture components by cumulative weight mass}
\usage{
.truncate_components_one_draw(w, params, epsilon = 0.01)
}
\arguments{
\item{w}{Numeric vector of component weights (length K).}

\item{params}{Named list of numeric vectors, each length K (component-specific params).}

\item{epsilon}{Numeric in [0,1). Keep the smallest k s.t. cumweight >= 1-epsilon.}
}
\value{
A list with reordered+truncated weights/params and bookkeeping.
}
\description{
Truncate and reorder mixture components by cumulative weight mass
}
\details{
This helper operates on one posterior draw at a time. It first orders mixture
components by decreasing weight, then keeps the smallest effective subset of
components implied by the package truncation rule, and finally renormalizes
the retained weights so they sum to one.

The same permutation is applied to every component-specific parameter vector in
\code{params}, which keeps the retained parameter blocks aligned with the retained
weights.
}
\keyword{internal}
