bacontrees: Bayesian Context Trees for Discrete Sequence Data
Models discrete sequential data using Bayesian Context Trees.
Context trees, also known as Variable Length Markov
Chains (VLMCs), are parsimonious Markov models where the order of
dependence can vary with the observed past. Provides a generic 'R6'
class structure that exposes the full tree
for building custom algorithms, exact Bayesian inference via a
bottom-up recursive algorithm (closed-form marginal likelihood,
Maximum A Posteriori (MAP) tree, exact posterior probabilities, and
exact sampling from the posterior), a frequentist estimator via the
context algorithm with likelihood-ratio pruning,
simulation utilities, and a Metropolis-Hastings sampler.
See Paulichen and Freguglia (2026) <doi:10.48550/arXiv.2603.25806>.
| Version: |
1.0.0 |
| Depends: |
R (≥ 4.1.0) |
| Imports: |
R6, stringr, glue, purrr, dplyr, progressr, Rcpp, igraph, ggraph, ggplot2, Brobdingnag |
| LinkingTo: |
Rcpp |
| Suggests: |
testthat (≥ 3.0.0) |
| Published: |
2026-05-12 |
| DOI: |
10.32614/CRAN.package.bacontrees (may not be active yet) |
| Author: |
Victor Freguglia
[aut, cre],
Thiago Paulichen
[ctb] |
| Maintainer: |
Victor Freguglia <victorfreguglia at gmail.com> |
| License: |
GPL (≥ 3) |
| NeedsCompilation: |
yes |
| Materials: |
README, NEWS |
| CRAN checks: |
bacontrees results |
Documentation:
Downloads:
Linking:
Please use the canonical form
https://CRAN.R-project.org/package=bacontrees
to link to this page.