Skip to contents

\(p(X_{n+1} \in \cdot | X_1..X_n) = \alpha/(\alpha+n) G_0 + (\alpha+n)^{-1}\sum_k n_k \delta_{X_k^*}\) (Sec. 4.1.4). Closed form: conjugacy (Sec. 4.1.3) makes the posterior \(DP(\alpha G_0 + \sum \delta_{X_i})\).

Usage

morie_dp_predictive(x, alpha = 1, grid = NULL)

Arguments

x

numeric observations.

alpha

positive concentration.

grid

evaluation points for the continuous part.

Value

list: grid, base_density, atoms, atom_probs, base_weight, atom_weight, n_distinct, is_density, limit_note, n, method.

Details

The predictive is NOT a density – it has an atom at every distinct observed value carrying total mass \(n/(\alpha+n)\), because a DP draw is almost surely discrete however smooth \(G_0\) is. Mirrors morie.fn.gh_dp_post_ex.

References

Ghosal and van der Vaart, Sec. 4.1.3-4.1.4.

Examples

set.seed(1)
morie_dp_predictive(rnorm(30), alpha = 2)$atom_weight
#> [1] 0.9375