Source: Ghosal, S. and van der Vaart, A. (2017), Fundamentals of Nonparametric
Bayesian Inference, chapter 3 (tail-free and Polya tree priors). For a set A_epsilon
in the partition at level epsilon, N_epsilon := #{1 <= i <= n : X_i in
A_epsilon}. Because a tail-free prior has independent partition-level masses, the
vector of cell counts at each level is what the posterior update consumes. Nothing is
estimated here; this is a count.
Usage
Tfcells(X_i, A_epsilon, n = NULL)
Arguments
- X_i
Numeric sample.
- A_epsilon
A cell, or a list of cells. A cell is either a
predicate function or a c(lo, hi) pair read as the half-open
interval [lo, hi), so consecutive breakpoints tile the line
without double counting.
- n
Use only the first n observations. Defaults to all.
Value
list: N_epsilon, proportion, n, method.
Examples
Tfcells(c(0.1, 0.4, 0.6, 0.9), list(c(0, 0.5), c(0.5, 1)))$N_epsilon
#> [1] 2 2