Locates x in the dyadic partition, counts how many of
data share each of its first depth bit prefixes, and
multiplies the level-wise posterior branching probabilities
\((2 a_m + 2 N_m) / (2 a_m + N_{m-1})\), with the canonical
level weights \(a_m = m^2\) and \(N_0\) the sample size. The
result is the posterior density relative to the uniform base measure.
References
Ghosal, S. and van der Vaart, A. (2017). Fundamentals of Nonparametric Bayesian Inference. Cambridge University Press.
Examples
V <- c(1, 2, 3, 4, 5, 6, 7, 8)
morie_gh_pt_posterior_density(V, V)
#> [1] 4.236923
