R Observatory
Search

bacontrees

1.0.0CRAN

Bayesian Context Trees for Discrete Sequence Data

install.packages("bacontrees")
CRAN 30-day downloads, method
317−21% down on the 30 days before, the worse direction
Test coverage, method
88%of lines run by tests

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.

Full description

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

Maintainer
Victor Freguglia
Licence
GPL (>= 3)
Latest release
12 May 2026
First release
12 May 2026

Compare with another package

More details
Releases
1
Needs compilation
Yes
Needs R
>= 4.1.0
Config/testthat/edition
3
LazyData
true
RoxygenNote
7.3.3
Subjects (1) Method, Subjects
Cite

Package

Run in R for the authors' preferred citation:

citation("bacontrees")
APA
Freguglia, V., & Paulichen, T. (2026). bacontrees: Bayesian Context Trees for Discrete Sequence Data (Version 1.0.0) [Computer software]. https://doi.org/10.32614/CRAN.package.bacontrees
About

This package has no citation file, so citation() returns this entry built from DESCRIPTION.

R Observatory

For a number measured here: a download total, a coverage figure, an archival date.

APA
Balamuta, J. J. (2026). R Observatory: Metrics for bacontrees version 1.0.0 [Data set]. HJJB, LLC. Data release v2026-10-29. https://doi.org/10.5281/zenodo.21843040
About

From data release v2026-10-29, which the citation names so these numbers can be found later.

All 13 check platforms pass.

  • r-devel-linux-x86_64-debian-clang

    The unreleased R on Linux, x86_64, debian-clang

    OK

    Version checked
    1.0.0
    Time taken
    166 s
  • r-devel-linux-x86_64-debian-gcc

    The unreleased R on Linux, x86_64, debian-gcc

    OK

    Version checked
    1.0.0
    Time taken
    118 s
  • r-devel-linux-x86_64-fedora-clang

    The unreleased R on Linux, x86_64, fedora-clang

    OK

    Version checked
    1.0.0
    Time taken
    112 s
  • r-devel-linux-x86_64-fedora-gcc

    The unreleased R on Linux, x86_64, fedora-gcc

    OK

    Version checked
    1.0.0
    Time taken
    108 s
  • r-devel-windows-x86_64

    The unreleased R on Windows, x86_64

    OK

    Version checked
    1.0.0
    Time taken
    254 s
  • r-oldrel-macos-arm64

    The previous release of R on macOS, arm64

    OK

    Version checked
    1.0.0
    Time taken
    45 s
  • r-oldrel-macos-x86_64

    The previous release of R on macOS, x86_64

    OK

    Version checked
    1.0.0
    Time taken
    144 s
  • r-oldrel-windows-x86_64

    The previous release of R on Windows, x86_64

    OK

    Version checked
    1.0.0
    Time taken
    236 s
  • r-patched-linux-x86_64

    The patched release of R on Linux, x86_64

    OK

    Version checked
    1.0.0
    Time taken
    156 s
  • r-release-linux-x86_64

    The current release of R on Linux, x86_64

    OK

    Version checked
    1.0.0
    Time taken
    158 s
  • r-release-macos-arm64

    The current release of R on macOS, arm64

    OK

    Version checked
    1.0.0
    Time taken
    42 s
  • r-release-macos-x86_64

    The current release of R on macOS, x86_64

    OK

    Version checked
    1.0.0
    Time taken
    160 s
  • r-release-windows-x86_64

    The current release of R on Windows, x86_64

    OK

    Version checked
    1.0.0
    Time taken
    187 s
  • 13 OK

Over time

No change since 8 Sep 2026

As a list (7)
ChangedWorst statusOKNotesWarningsErrors
8 Sep 2026OK13000
7 Sep 2026Error12001
5 Aug 2026OK13000
1 Aug 2026Note12100
9 Jun 2026OK13000
8 Jun 2026Error12001
13 May 2026OK7000

Since March 2026

Check results on CRAN

Total downloads in the last 30 days
369−18.7% down on the 30 days before, the worse directionIt is the sum of 3 channels: CRAN, r2u and autoCRAN.

CRAN rank

12,770 of 26,553

CRAN

317 downloads in the last 30 days

Rank
12,770 of 26,553
Change
−21% down on the 30 days before, the worse direction

It is in the total. Take it out

r2u

17 downloads in the last 30 days

Rank
5,162 of 30,526
Change
no change on the 30 days before

It is in the total. Take it out

autoCRAN

35 downloads in the last 30 days

Rank
1,219 of 29,233
Change
−2.8% down on the 30 days before, the worse direction

It is in the total. Take it out

Over time

Compare downloads

Needs
11
Dependent packages
0
Suggested by
0
Needs (11)
Installing it adds
49 packages, 49.1 MB of source
Of those, need compilation
30
Optional extras (1)
Functions
22
Public exports
6
Lines of R code
1,472
Median complexity
1
Functions (22)
Size and composition

Lines by kind (3,598)

KindLinesShare
R code1,47241%
Tests75021%
Documentation1,29336%
Compiled code832%

Lines by language

LanguageLinesShare
R2,22262%
Rd1,29336%
C++832%

Languages are counted from file extensions.

Files
50
R functions
17
Compiled functions
5
Object systems
S3: 3 methods, R6: 5 classes
Complexity
Median
1
Mean
2.29
Highest
6
Median lines per function
9
About complexity

Cyclomatic complexity counts the independent paths through a function: 1 is a straight line, higher is harder to test. R functions only.

Call graph figures
R functions
17
Calls
4
Unconnected
10
Groups
3

The tests ran and coverage was measured.

Lines run by tests
87.6%
Expressions run by tests
90.8%
Test cases
77
Exports named in tests
100%
Coverage by file (12)
Coverage run
Lines counted
612
Lines the tests ran
534
Tests passed
Yes
Measured with
covr 3.6.5 on R 4.6.1
Test suite
Has tests
Yes
Test frameworks
testthat
Test cases
77
Lines of tests
750
Test lines per line of code
0.51
Exports documented
100%
Arguments documented
95.8%
Return value documented
83.3%
Help pages with examples
54.5%
Examples run in checks
100%
Other documentation
README
Yes, 1,061 words
Release notes file
Yes
Help pages
11
Lines of documentation
1,293
DatasetSize
abc_listSimulated Sequence Data from a Variable Length Markov Chain (VLMC)length 3
abc_vecSimulated Sequence Data from a Variable Length Markov Chain (VLMC)length 1,000

No repository on record

R releases
  • On CRAN
  • Release
VersionReleasedR
1.0.0 current12 May 20264.6.0