Skip to contents

w ~ Di(a + counts) under a symmetric Di(a) prior (ESL eqs 8.32-8.34), with mean, variance and the multinomial bootstrap variance w (1 - w) / N.

Usage

morie_esl_dirichlet_posterior(counts, a = 0)

Arguments

counts

Category counts.

a

Prior concentration (0 is the noninformative limit).

Value

Named list: alpha, mean, var, bootstrap_var.

References

Hastie, Tibshirani & Friedman (2009), sec. 8.4.

Examples

morie_esl_dirichlet_posterior(c(12, 5, 3))$mean
#> [1] 0.60 0.25 0.15