Given two hyperdirichlet distributions, “add” them, in the sense
of concatenating their information, assumed to be independent.
Usage
hd_add(e1, e2, assume_validated = FALSE)
Arguments
e1,e2
Hyperdirichlet distributions of the same dimension
assume_validated
Boolean, with default FALSE meaning
that the returned sum cannot be assumed to be proper; so the
returned hyperdirichlet object is tested with is.proper()
(which is time-consuming). Set to TRUE only when you know
that the sum is proper
Value
Returns a hyperdirichlet distribution
Details
Think of this function as a computerized embodiment of Bayes's theorem
with e1 representing the prior and e2 representing one
or more informative trials.
The basic guts of the function is hyperdirichlet(powers(e1) +
params(e2)). Note that this is equivalent to
hyperdirichlet(params(e1) + powers(e2)).
The functional form is not really intended for the end user; use
e1 + e2 instead (but observe that the sum will be validated
using is.proper(), which may take a long time).