View source: R/msBP.nrvTrees.R
msBP.nrvTrees | R Documentation |
Compute the path of each subject in the binary tree of weights and returns 3 tree: the n
tree, the r
tree, and the v
tree (see values
msBP.nrvTrees(sh, maxS = max(sh[,1]))
sh |
A matrix with 2 columns and a number of rows equal to the sample size denoting the scale and node labels of each unit |
maxS |
Upper bound for the scale |
A list containing tree objects of the class binaryTree
. n
is the tree containing at each node the number of subjects allocated to that node, r
is the tree containing at each node the number of subjects that went right at that node, and v
is the tree containing at each node the number of subjects that passed through that node.
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.
sh <- cbind(c(2,2,2,3,3,3,3,3,3,3), c(1,2,2,1,2,3,4,5,6,7))
nrv.trees <- msBP.nrvTrees(sh)
plot(nrv.trees$n)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.