msBP.postCluster: Posterior cluster allocation

View source: R/msBP.postCluster.R

msBP.postClusterR Documentation

Posterior cluster allocation

Description

Perform the posterior multiscale cluster allocation conditionally on a tree of weights. See Algorithm 1 in Canale and Dunson (2016).

Usage

msBP.postCluster(y, weights)

Arguments

y

the sample of individials to be allocated to binary tree structure

weights

the binary tree of weights (summing to one). An object of the class msBPTree

Details

conditionally on the weights contained in weights, each subject in y is allocated to a multiscale cluster using Algorithm 1 of Canale and Dunson (2016). It relies on a multiscale modification of the slice sampler of Kalli et al. (2011).

Value

a matrix with length(y) row and two columns, denoting the scale and node within the scale, respectively.

References

Canale, A. and Dunson, D. B. (2016), "Multiscale Bernstein polynomials for densities", Statistica Sinica, 26(3), 1175-1195.

Canale, A. (2017), "msBP: An R Package to Perform Bayesian Nonparametric Inference Using Multiscale Bernstein Polynomials Mixtures". Journal of Statistical Software, 78(6), 1-19.

Kalli, M., Griffin, J., and Walker, S. (2011), "Slice sampling mixture models," Statistics and Computing, 21, 93-105.

See Also

msBP.Gibbs

Examples

set.seed(1)
y <- rbeta(30, 5, 1)
weights <-structure(list( 
	T = list(0, c(0,0.10), c(0.0,0,0.3,0.6)), max.s=2), 
	class  = 'binaryTree')
sh <- msBP.postCluster(y, weights)
clus.size <- msBP.nrvTrees(sh)$n
plot(clus.size)

msBP documentation built on Aug. 23, 2023, 1:06 a.m.