[Paper Review] Bayesian Context Trees: Modelling and exact inference for discrete time series
This paper introduces a Bayesian context tree (BCT) framework for exact inference in variable-memory Markov chains, enabling efficient computation of prior predictive likelihood, posterior model probabilities, and top-k model identification via linear-time deterministic algorithms. The method outperforms VLMC, MTD, SMC, and CTF in prediction accuracy, achieving up to 4.8% lower log-loss on real-world data, with the BCT consistently ranking first across multiple datasets including finance, genetics, and animal communication.
We develop a new Bayesian modelling framework for the class of higher-order, variable-memory Markov chains, and introduce an associated collection of methodological tools for exact inference with discrete time series. We show that a version of the context tree weighting algorithm can compute the prior predictive likelihood exactly (averaged over both models and parameters), and two related algorithms are introduced, which identify the a posteriori most likely models and compute their exact posterior probabilities. All three algorithms are deterministic and have linear-time complexity. A family of variable-dimension Markov chain Monte Carlo samplers is also provided, facilitating further exploration of the posterior. The performance of the proposed methods in model selection, Markov order estimation and prediction is illustrated through simulation experiments and real-world applications with data from finance, genetics, neuroscience, and animal communication. The associated algorithms are implemented in the R package BCT.
Motivation & Objective
- Address the limitations of full Markov chains and traditional variable-memory models in balancing bias-variance tradeoffs and modeling flexibility.
- Overcome the computational and statistical inefficiencies of maximum likelihood-based methods like VLMC and MTD, which can assign zero probability to observed symbols.
- Develop a fully Bayesian framework that enables exact computation of posterior probabilities and prior predictive likelihood for variable-memory Markov chains.
- Provide efficient, linear-time algorithms for model selection, prediction, and posterior exploration, suitable for large-scale or sequential data.
- Facilitate uncertainty quantification and model averaging through exact Bayesian inference and variable-dimension MCMC samplers.
Proposed method
- Propose a Bayesian context tree (BCT) model that treats the context tree structure and transition probabilities as random variables, with conjugate Dirichlet priors.
- Introduce the Context Tree Weighting (CTW) algorithm to compute the prior predictive likelihood exactly by averaging over all possible context trees and their parameters.
- Develop the BCT algorithm to identify the a posteriori most likely context tree and compute its exact posterior probability.
- Design the k-BCT algorithm to return the top-k most probable context trees efficiently, enabling robust model selection.
- Implement variable-dimension Markov chain Monte Carlo (MCMC) samplers that explore the posterior distribution over context trees and parameters.
- Enable sequential prediction and online updates by leveraging the exact posterior computation and predictive distributions derived from model averaging.
Experimental results
Research questions
- RQ1Can exact Bayesian inference be efficiently performed over the space of variable-memory Markov chains with unknown context tree structures?
- RQ2How does the proposed Bayesian context tree framework compare to existing methods like VLMC, MTD, SMC, and CTF in terms of prediction accuracy and robustness?
- RQ3To what extent does model averaging via posterior computation improve predictive performance compared to point estimation of a single best model?
- RQ4Can linear-time exact algorithms be developed for prior predictive likelihood and posterior model probabilities in this class of models?
- RQ5How does the framework perform in real-world applications with complex temporal dependencies, such as in neuroscience, finance, and animal communication?
Key findings
- The BCT method achieved the lowest log-loss across all tested datasets, outperforming CTF (second best) by up to 4.8% on the last 10% of test data.
- On the Pewee birdsong dataset, BCT had a log-loss 13.2% lower than SMC and 1.2% lower than CTF, while VLMC and MTD failed with infinite log-loss due to zero-probability predictions.
- The BCT algorithm computed the prior predictive likelihood exactly and efficiently, with linear-time complexity, enabling scalable inference.
- The k-BCT algorithm successfully identified the most probable context trees, with performance close to the full BCT method but with reduced computational cost.
- The variable-dimension MCMC samplers enabled accurate posterior exploration, supporting uncertainty quantification and robust model selection.
- The Bayesian framework significantly outperformed SMC, which relies on a single MAP model, highlighting the advantage of model averaging in BCT.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.