Package: | hyperdirichlet |
Type: | Package |
Version: | 1.1-8 |
Date: | 2008-03-26 |
License: | GPL |
This package provides a generalization of the Dirichlet distribution that is useful for analyzing multinomial trials with a priori restrictions.
As an example, consider six people (“players”), numbered 1 to 6. These players are members of a running club and regularly race one another.
Each player has an associated number
We wish to make inferences about the
If all six race and
With a uniform prior, the posterior is Dirichlet.
The players now have a race but only
This distribution is not a Dirichlet distribution but is representable in this package; the R idiom would be
jj <- dirichlet(powers = c(5,4,3,5,3,2))
jj <- jj + mult_restricted_obs(6, 1:3, c(4,5,2))
where the first line specifies a Dirichlet distribution for the all-play data and the second line augments the likelihood with the observations from the restricted race.
jj <- dirichlet(powers = c(5,4,3,5,3,2))
jj <- jj + mult_restricted_obs(6, 1:3, c(4,5,2))
data(icons)
maximum_likelihood(as.hyperdirichlet(icons))
Run the code above in your browser using DataLab