Formula: P(z_i | z_{-i}, y) with theta marginalized
Value
List with estimate (number of clusters), z,
counts, cluster_mean, n_clusters,
loglik, n, method.
Details
P(z_i = k | .) proportional to n_k^{-i} f(y_i | y_{-i,k}) and to alpha f(y_i) for a new table, with the normal-normal predictive density in closed form. Marginalising theta is what collapses the sampler: no cluster parameters are ever stored.
References
MacEachern (1994), Commun. Statist. B 23(3):727-741; Neal (2000), J. Comput. Graph. Statist. 9(2):249-265, algorithm 3.
Examples
V <- c(1, 2, 3, 4, 5, 6, 7, 8)
Crpcol(V)
#> $estimate
#> [1] 3
#>
#> $z
#> [1] 1 1 1 2 0 0 0 0
#>
#> $counts
#> [1] 4 3 1
#>
#> $cluster_mean
#> [1] 6.341463 1.935484 3.636364
#>
#> $n_clusters
#> [1] 3
#>
#> $loglik
#> [1] -10.97414
#>
#> $n
#> [1] 8
#>
#> $method
#> [1] "collapsed Gibbs sampler for a CRP mixture"
#>
#> attr(,"class")
#> [1] "morie_rich_result" "list"
