
Monte Carlo draws of a reporting information fraction
Source:R/reporting_if.R
reporting_if_draws.RdUse as at_ifrac in modifiers(), combined(), and interactions() to
average marginal effects over an uncertain combined-population reporting
fraction \(\pi^\star\) while keeping a single \(\pi^\star\) on each
CAMS mixture evaluation (outer draws) and the usual \(\tau\) support grid
inside each evaluation (inner nodes in fit$support).
Arguments
- n
Number of outer Monte Carlo draws of \(\pi^\star\).
- fun
Optional function of
nreturning values in[0, 1]. WhenNULL, draws fromstats::rbeta(n, shape1, shape2).- shape1, shape2
Beta shape parameters when
funisNULL.- seed
Optional integer; forwarded to
set.seed()before sampling.
Value
An object of class interactmeta_reporting_if_draws (length n
via length(), values in $values).
Details
This is not the same as passing stats::rbeta(B, …) with
length(B) \neq nrow(fit$support): that length is reserved for assigning
different \(\pi^\star\) to each inner node in one pass.
Relation to at_ifrac = NULL and ifrac()
With at_ifrac = NULL, modifiers() takes \(\omega\) from ifrac() on the
fitted object (ifrac = "interaction" or "combined"). Because \(\tau\) and
\(\tau_\gamma\) vary across fit$support, pooled \(\omega\) is a
distribution on the quadrature grid; that path already mixes effects with
.weight (exact for the DIRECT posterior). Use that default when fit-based
\(\pi^\star\) is enough.
reporting_if_draws() adds outer Monte Carlo over a user distribution on
reporting \(\pi^\star\) (e.g. \(\mathrm{Beta}(5,7)\)). fit_reporting_if_draws()
uses the same outer API with \(\omega\) drawn via ifrac(..., tau_sampling = "posterior") (marginal \(\tau\) MC) for each outer row.
See also
modifiers() at_ifrac