R/hypothesis-BF-evaluation.R
prior_ordinate_status.Rdprior_ordinate_status() applies the exactness rule of point
hypotheses (hypothesis_BF(), Savage_Dickey_BF()) to a prior density at
each requested value and reports the outcome instead of stopping. A value is
eligible for a Savage-Dickey point hypothesis when its prior ordinate is
"regular", classified exactly by prior_density_ordinate(), and has an
available log density. Otherwise the row names the condition class and the
message with which a point hypothesis at that value stops.
prior_ordinate_status(prior_density, values, labels = NULL)a BayesTools prior or a prior_linear_density, as
accepted by prior_density_ordinate().
finite numeric values of the point hypotheses (at least one).
optional labels of the point hypotheses used in the messages, one per value; defaults to the values.
A data frame with one row per value and the columns
valuethe value.
eligiblewhether a point hypothesis at the value has an exact regular prior ordinate.
conditionthe class of the error a point hypothesis at the value
stops with: "BayesTools_point_mass_at_null",
"BayesTools_infinite_ordinate", "BayesTools_zero_ordinate",
"BayesTools_undefined_ordinate", or "BayesTools_inexact_ordinate"
(all also of class BayesTools_hypothesis_ordinate); NA when
eligible.
reasonthe message of that error; NA when eligible.
continuous_behaviorthe behavior of the prior without its point
masses at the value ("regular", "zero", "infinite",
"undefined", or "unknown"): the ordinate's
provenance$continuous_behavior at a point mass and its behavior
otherwise.
spike_and_slab <- prior_mixture(
list(
prior("point", list(location = 0), prior_weights = 1),
prior("normal", list(mean = 0, sd = 1), prior_weights = 1)
),
is_null = c(TRUE, FALSE)
)
prior_ordinate_status(spike_and_slab, c(0, 0.5))
#> value eligible condition
#> 1 0.0 FALSE BayesTools_point_mass_at_null
#> 2 0.5 TRUE <NA>
#> reason
#> 1 There is a point mass in the prior at the exact null hypothesis value. The Savage-Dickey density ratio is invalid.
#> 2 <NA>
#> continuous_behavior
#> 1 regular
#> 2 regular