Maximum Likelihood Estimate (MLE) of Beta-Binomial (BB) model. Some details about this model can be found on the following tutorial https://rpubs.com/cakapourani/beta-binomial
bb_mle(x, w = NULL, n_starts = 10, lower_thresh = 0.001)
An n x 2 data.table or matrix, where 1st column keeps total number of trials and 2nd column number of successes, n is the total number of samples.
Vector with initial values of
Total number of restarts when optimisation fails.
Threshold when to stop optimisation.
A list with the following elements:
The overdispersion parameter. This is the most important parameter, since
it tells us if and how much overdispersion we observe in the data that
cannot be explained by the Binomial model.
mu: The mean
parameter, i.e. success probability of the beta binomial.
alpha: Alpha parameter, when taking the different
parametrisation of the BB.
beta: Beta parameter, when taking
the different parametrisation of the BB.
whether or not the optimisation converged.
likelihood ratio test statistic, for testing whether the Binomial or the
Beta-Binomial fit better the data.
chi2_test: The p-value
from the Chi-squared test obtained from the LRT statistics.
Z_score: The Z score statistic proposed by Tarone (1979).
Seems more stable than LRT, in test whether we have overdispersion in our
z_test: The p-value obtain from the Z-score statistic.
bb_ll: Beta binomial log likelihood (used internally to
compute the LRT statistic and the BIC)
BIC_bb: The Bayes
Information Criterion for beta binomial model
Binomial log likelihood (used internally to compute the LRT statistic and
BIC_bin|: The Bayes Information Criterion for binomial model
# Extract data from a single Feature x <- scmet_dt$Y[Feature == "Feature_1", c("total_reads", "met_reads")] fit_mle <- bb_mle(x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.