R/var_attributes.R
variable-attributes.Rd
Attributes give additional information useful for presenting SBC results concerning the variables.
var_attributes(...)
validate_var_attributes(var_attr)
possibly_constant_var_attribute()
binary_var_attribute()
hidden_var_attribute()
na_valid_var_attribute()
inf_valid_var_attribute()
submodel_var_attribute(sub_id)
Should be passed via an instance of the var_attributes
class to
SBC_datasets()
(e.g. by returning a $var_attributes
element from a
function passed to SBC_generator_function()
).
possibly_constant_var_attribute
attribute signals that having all
posterior draws identical is possible and thus no warnings should be
made for the resulting NAs in rhat and ESS checks.
binary_var_attribute
marks the attribute as a binary variable (0 or 1)
and thus eligible for some special handling and visualisations
(e.g., binary_probabilites_from_stats()
, binary_calibration_from_bp()
).
hidden_var_attribute
will hide the variable in default visualisations,
unless the variable is explicitly mentioned.
na_valid_var_attribute
will treat NAs as potentially equal to any
other value in rank ordering. This gives the expected results when NA
represents rare problems in computation that
should be ignored (see calculate_ranks_draws_matrix()
). Setting this
attribute also changes the ESS/Rhat computation to ignore NAs.
inf_valid_var_attribute
means infinity values may appear in the samples
(this is useful e.g. to note that the parameter is actually not present for the
given draw). Setting this
attribute also changes the ESS/Rhat computation to ignore infinities.
submodel_var_attribute
signals that the parameter belongs to a submodel
which can be extracted individually
In SBC results, the attributes of a variable are summarised in the
attributes
column of the $stats
data.frame. Use attribute_present_stats()
to check for presence of an attribute there.