Skip to contents

After n observations, the next draw is a fresh value from the base measure with probability \(\alpha / (\alpha + n)\) and equals any given past observation with probability \(1 / (\alpha + n)\).

Usage

morie_gh_dp_predictive(alpha, n)

Arguments

alpha

Dirichlet-process precision (positive)

n

number of observations already drawn

Value

list with elements weight_fresh (probability of a draw from the base measure) and weight_per_obs (probability attached to each individual past observation)

References

Ghosal, S. and van der Vaart, A. (2017). Fundamentals of Nonparametric Bayesian Inference. Cambridge University Press.

Examples

V <- c(1, 2, 3, 4, 5, 6, 7, 8)
morie_gh_dp_predictive(V, V)
#> $weight_fresh
#> [1] 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5
#> 
#> $weight_per_obs
#> [1] 0.50000000 0.25000000 0.16666667 0.12500000 0.10000000 0.08333333 0.07142857
#> [8] 0.06250000
#>