
Empirical Bayes for the Dirichlet concentration
Source:R/ghosal_native.R
morie_empirical_bayes_dp.Rd\(\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.
Value
list: alpha_hat, alpha_grid, log_marginal, n_clusters, understates_uncertainty, fully_bayes_alternative, n, method.
Examples
morie_empirical_bayes_dp(rep(1:3, each = 20))$n_clusters
#> [1] 3