Learn R Programming

msBP (version 1.4-1)

msBP.postCluster: 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)

Value

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

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).

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

Run this code
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)

Run the code above in your browser using DataLab