Learn R Programming

⚠️There's a newer version (1.2) of this package.Take me there.

BCT (version 1.1)

Bayesian Context Trees for Discrete Time Series

Description

An implementation of a collection of tools for exact Bayesian inference with discrete times series. This package contains functions that can be used for prediction, model selection, estimation, and other statistical tasks. Specifically, the functions provided can be used for the exact computation of the prior predictive likelihood of the data, for the identification of the a posteriori most likely (MAP) variable-memory Markov models, for calculating the exact posterior probabilities and the AIC and BIC scores of these models, and for prediction with respect to log-loss and 0-1 loss. All the functions here (except generate_data) are implementations of deterministic algorithms that have linear complexity in the length of the input data. Example data sets from finance, genetics and animal communication are also provided. Detailed descriptions of the underlying theory and algorithms can be found in [Kontoyiannis et al. 'Bayesian Context Trees: Modelling and exact inference for discrete time series.' [stat.ME], July 2020].

Copy Link

Version

Install

install.packages('BCT')

Monthly Downloads

204

Version

1.1

License

GPL (>= 2)

Maintainer

Valentinian Lungu

Last Published

December 7th, 2020

Functions in BCT (1.1)

gene_s

SARS-CoV-2 gene S
ML

Maximum Likelihood
compute_counts

Compute empirical frequencies of all contexts
kBCT

k-Bayesian Context Trees (kBCT) algorithm
MAP_parameters

Parameters of the MAP model
BCT

Bayesian Context Trees (BCT) algorithm
draw_models

Plot the results of the BCT and kBCT functions
generate_data

Sequence generator
SP500

Daily changes in the S&P 500 index
log_loss

Calculating the log-loss incurred in prediction
show_tree

Plot tree with given contexts
pewee

Pewee birdsong
prediction

Prediction
CTW

Context Tree Weighting (CTW) algorithm
sars_cov_2

SARS-CoV-2 genome
zero_one_loss

Calculating the 0-1 loss incurred in prediction