R/JAGS-parameter-mixed-posterior.R
parameter_mixed_posterior.Rdparameter_mixed_posterior() returns the posterior draws of one
semantic quantity of the parameter_catalog() as a mixed posterior (the
element form returned by as_mixed_posteriors()) together with the draw
metadata that inference and plots need (posterior_metadata()):
supportthe exact support declared by the catalog.
componentsordinary mixture/spike component indices and declared supports decoded from the same original fitted indicator rows before public coordinate filtering. Conditioned draws keep their original row identities; component supports never come from observed draw ranges.
prior_densitythe canonical prior density,
parameter_prior_density() (conditional on the inclusion event with
conditional = TRUE).
atomsthe declared posterior point masses, from the structure
of the quantity, never inferred from the draw values: the atoms on which
the per-draw states of its inclusion gates and point components put it
(parameter_gate_states(): the gates of a variance allocation, the
mixture indicator of a scale prior with a point component, or the
component indicator of a mixture or spike-and-slab prior of its fitted
coordinates), with masses the shares of those draws and locations that
match the point masses of the prior density when it is available. A
quantity whose prior density has no point mass declares no atoms, and so
does a quantity without a prior density none of whose fitted coordinates
can take a point mass: each is owned by a continuous prior (including the
Dirichlet weights of a variance allocation), is a continuous generated
primitive (e.g. the correlations of an LKJ block), or is a generated
random-effect SD or correlation node (JAGS_deterministic_nodes()) all
of whose dependencies are such coordinates (e.g. the SDs of a variance
allocation without inclusion gates whose scale prior has no point
component, so the original-scale correlations of an allocated us()
block declare no atoms). A random-effect correlation is scale-invariant,
so a coordinate that enters its block only as a common factor of every
SD (the scale source of the allocation that splits the block into its
SDs, or an inclusion gate of the whole block, also with point masses)
puts no atom on it: where the factor is 0, every SD is 0 and the
correlation is undefined. The original-scale correlations of a block
allocated from a gated or spike-and-slab scale therefore declare no atoms
on their defined draws. Atoms remain undeclared (and posterior plots and
Savage-Dickey ratios stop) when the point states are not in the draws (an
unmonitored component indicator), when the quantity combines several
coordinates of which some can take a point mass (e.g. original-scale
random-effect SDs of a block with spike-and-slab SD priors, and
original-scale correlations of a block whose SDs have their own
spike-and-slab priors or inclusion gates, which can be -1 or 1 where one
SD is 0), and when the point structure of a fitted coordinate is not
classified: coordinates of priors that are neither continuous, point,
mixture, spike-and-slab, nor selection priors, and coordinates without a
prior other than LKJ primitives, standardized random effects, generated
random-effect SD and correlation nodes, and selection coordinates (e.g.
add_parameters, such as a formula's linear predictor, which is constant
on rows whose design is zero, and the _indicator, _inclusion, and
_variable coordinates of mixture priors). The coordinates of a
weight-function, publication-bias, or publication-bias mixture prior (the
weights omega, PET, PEESE, and the p-hacking alpha, pi_null,
beta_null, and phack_kind) are declared from the value each branch of
the prior gives them: a constant weight (the reference bin, fixed
weights, or 1 in a branch without a selection), 0 for PET and PEESE
in branches without them and for the p-hacking parameters in branches
without p-hacking, and the form code of phack_kind, with masses the
shares of the draws whose branch (the bias_indicator of a mixture)
gives the constant.
undefined_drawsfor quantities that are undefined on some
fitted draws (the catalog definedness, e.g. variance proportions when
no allocation component is active), the reason; those draws are omitted,
and the prior density and atom masses are conditional on definedness.
conditionthe conditioning of the draws: unconditional
(averaged = TRUE), or the inclusion event of the quantity.
quantitiesthe catalog quantity of the draws: its id and label
parts, from which parameter_labels() and the summaries render its
labels.
parameter_mixed_posterior(
fit,
selection,
conditional = FALSE,
transform_scaled = TRUE
)a model fitted with JAGS_fit().
a selection of one catalog quantity, created with
parameter_catalog_resolve() from the catalog of the fit
(parameter_catalog()) or, with transform_scaled = FALSE, from the
catalog of the fitted scale (parameter_catalog(fit, transform_scaled = FALSE)); a selection of the latter with transform_scaled = TRUE stops.
whether to condition on the inclusion event of the
quantity: the gates of its allocation chain on for an allocation-derived
component SD or variance, and its own inclusion gate on for a variance
proportion; for a quantity of the fitted coordinates of one mixture or
spike-and-slab prior with point components (a coefficient, a factor
level, a random-effect SD or variance, or the scalar correlation of a
structured block on any cor_scale), the component indicator of that
prior selecting a continuous component (the "alternative" components of
a prior whose components are "null" and "alternative", the event of
JAGS_estimates_table(conditional = TRUE) and of
as_mixed_posteriors(conditional = <parameter>)). An allocation total
(sd_total, var_total) is conditioned
on its parent-allocation (binding-factor) gates on when some component
has no inclusion gate (some component is then always active), and on at
least one component active when every component has an inclusion gate
and the total has no parent gates. A total whose components all have
inclusion gates and which also has parent gates combines the two kinds of
gates, which are not one conjunction or disjunction, and is refused
("combines parent-allocation and component inclusion gates"). Only the
draws in the
event are kept, and the prior density is
restricted to the event and renormalized (point masses inside the event,
e.g. a variance proportion of one, keep their renormalized masses; the
prior of a point-component quantity is restricted to its continuous
components, with their prior probabilities renormalized to 1, on the
scale of the quantity, and declares no atom, the point components being
the complement of the event). The declared condition names the gates
(the component indicator) of the event, and the declared support is
that of the event: the catalog support under the restricted prior for a
point-component quantity, and the catalog support without the points the
event excludes (the atom at 0 of a gate that is off) for a gated
allocation quantity. Quantities without an inclusion
gate cannot be conditioned, nor can a total of an allocation without
parent gates that has an ungated component, the coordinates of a
selection prior (weight function, PET/PEESE, p-hacking), the inclusion
indicator of a component, a quantity whose prior has other components
than "null" and "alternative" or a point "alternative" component,
one whose component indicator is not monitored, and a quantity that
combines several coordinates of which some can take a point mass (e.g.
original-scale SDs of a block with spike-and-slab SD priors); each stops
with a message naming the reason.
whether the random-effect quantities (SDs,
variances, and correlations) of a fit with scaled predictors are reported
on the original scale (TRUE, the default) or on the fitted scale of the
standardized predictors (FALSE), as for JAGS_estimates_table(). The
draws, the declared support and atoms, and the prior density share the
scale. Fits without scaled predictors, and quantities that the scaling
does not affect, are unchanged.
A numeric vector of class mixed_posteriors,
mixed_posteriors.simple, marginal_posterior.simple, and
marginal_posterior (attribute parameter: the canonical name) with the
draw metadata described above.