Skip to contents

The constructors in prior_families take numeric vectors, one entry per parameter or one shared entry, and every one of them ends up inside a stats::d*()/q*() pair. Those are quiet about nonsense: dgamma(x, shape = -1) returns NaN with a warning, qgamma(u, shape = 0) returns zeros, and either way the mistake surfaces as a prior sample full of NaNs once the simulation budget is already spent. The values are listed rather than described, as check_counts() does, since which entry is wrong is the thing worth reading.

Usage

check_family_param(value, arg, positive = FALSE)

Arguments

value

The user's value.

arg

Name of the argument.

positive

Require every entry to be strictly positive, for a scale, a rate or a shape.

Value

value, unchanged.

Details

Names are left on the value: family_param_names() reads the parameter names off whichever argument carries them, and that has to happen after validation.