Skip to contents

\(\hat\alpha\) maximises the marginal likelihood, which under the Polya urn depends on the data only through the PARTITION: \(k\log\alpha + \log\Gamma(\alpha) - \log\Gamma(\alpha+n)\). So \(\hat\alpha\) is driven by the number of clusters. Plugging it back in treats an estimated hyperparameter as known and can under-cover, which understates_uncertainty records. Mirrors morie.fn.gh_emp_bayes.

Usage

morie_empirical_bayes_dp(x, alpha_grid = NULL, sigma = 1)

Arguments

x

numeric observations; ties define the clusters.

alpha_grid

positive concentrations searched over.

sigma

retained for interface symmetry.

Value

list: alpha_hat, alpha_grid, log_marginal, n_clusters, understates_uncertainty, fully_bayes_alternative, n, method.

References

Ghosal and van der Vaart, Ch. 4 and Ch. 6; Antoniak (1974).

Examples

morie_empirical_bayes_dp(rep(1:3, each = 20))$n_clusters
#> [1] 3