Learn R Programming

bifurcatingr

Bifurcating autoregressive (BAR) models are commonly used to model binary tree-structured data that appear in many applications, most famously cell-lineage applications. The BAR model is an extension of the autoregressive (AR) model where each line of descent considers an AR process with the modification that the observations on the two sibling cells who share the same parent are correlated. In practice, the BAR model is used to explain the progression of single-cell proliferation. The goal of the bifurcatingr package is to provide a collection of functions that can be used for analyzing bifurcating autoregressive data. The package implements the least squares estimation of bifurcating autoregressive models of any order, p, BAR(p), and allows for executing several types of bias correction on the least-squares estimators of the autoregressive parameters including different types of confidence intervals. Currently, the bias correction methods supported include bootstrap (single, double, and fast-double) bias correction and linear-bias-function -based bias correction. The library also contains functions for generating and plotting bifurcating autoregressive data from any BAR(p) model.

Installation

You can install the development version of bifurcatingr like so: You can install the released version of bifurcatingr from CRAN with:

 install.packages("bifurcatingr")

Example

This is a basic example which shows you how to use bifurcatingr to fit a bifurcating autoregressive model to the ecoli dataset which contains the lifetimes of lineage E. coli cells.

library(bifurcatingr)
#> Loading required package: fMultivar
## basic example code
data("ecoli")
## Fitting a BAR(p=1) model to the `ecoli` dataset:

    bfa_ls(ecoli$lifetime, p = 1, conf = TRUE, conf_level = 0.95, 
           p_value = TRUE, cov_matrix = TRUE)
#> $coef
#>      Intercept  X_[t/2]
#> [1,]  17.61658 0.355198
#> 
#> $p_value
#>       Intercept  X_[t/2]
#> [1,] 0.01079535 0.181183
#> 
#> $error_cor
#> [1] 0.5836975
#> 
#> $cov_matrix
#>            Intercept    X_[t/2]
#> Intercept 1480.39874 -56.147524
#> X_[t/2]    -56.14752   2.187566
#> 
#> $asymptotic_ci
#>                 2.5%      97.5%
#> Intercept  4.0722831 31.1608852
#> X_[t/2]   -0.1654543  0.8758503
#> 
#> $bootstarp_ci
#>                2.5%     97.5%
#> Intercept  4.993058 30.240110
#> X_[t/2]   -0.105760  0.816156
#> 
#> $percentile_ci
#>                 2.5%      97.5%
#> Intercept  6.8659866 29.4617318
#> X_[t/2]   -0.1032912  0.7103112

Copy Link

Version

Install

install.packages('bifurcatingr')

Monthly Downloads

206

Version

2.1.0

License

AGPL (>= 3)

Maintainer

Tamer Elbayoumi

Last Published

April 8th, 2024

Functions in bifurcatingr (2.1.0)

ecoli

Lifetimes (in minutes) of lineage E. coli cells.
emt6

Mean Lifetimes (in tenths of hours) of EMT6 (BALB/c mouse mammary tumor) cells.
bfa_ls

Least Squares Estimation of Bifurcating Autoregressive Models
bfa_boot_ls_bc

Bootstrap of Bias-Correction Least Squares Estimators of BAR(p) Models
bfa_boot2_ls

Double Bootstrap of Least Squares Estimators of BAR(p) Models
bfa_boot2fast_ls

Fast Double Bootstrap of Least Squares Estimators of BAR(p) Models
bfa_perc_bc_ci

Bias Correction Percentile Confidence Interval Function
bfa_ls_bc_ci

Bias-Corrected Confidence intervals of Least Squares Estimators for Bifurcating Autoregressive Models
bfa_ls_bc

Bias-Corrected Least Squares Estimators for Bifurcating Autoregressive Models
bfa_boot1_ls

Single Bootstrap of Least Squares Estimators of BAR(p) Models
bfa_lbc_ls

Linear Function Bias-Corrected Estimators for BAR(p); p=1,2,...,6
bfa_boot_ci

Standard Normal Bootstrap Confidence Interval Function
rmnorm

Multivariate Normal Generator
rcontmnorm

Contaminated Normal Generator
bfa_subtree

Subtree Extractor
bfa_perc_ci

Percentile Bootstrap Confidence Interval Function
bfa_scatterplot

Scatterplots for Bifurcating Autoregressive Data
bfa_tree_plot

Plotting Bifurcating Autoregressive Trees
boot_bca_ci

Bias-Corrected and Accelerated bootstrap Confidence Interval (BCa) Function.
bfa_tree_gen

Bifurcating Autoregressive Tree generator