bb_mle | R Documentation |
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)
x |
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. |
w |
Vector with initial values of |
n_starts |
Total number of restarts when optimisation fails. |
lower_thresh |
Threshold when to stop optimisation. |
A list with the following elements:
gamma
:
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.
is_conv
: Logical,
whether or not the optimisation converged.
lrt
: The
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
data.
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
bin_ll
:
Binomial log likelihood (used internally to compute the LRT statistic and
the BIC.)
BIC_bin|
: The Bayes Information Criterion for binomial model
C.A.Kapourani C.A.Kapourani@ed.ac.uk
scmet
, scmet_differential
,
scmet_hvf_lvf
# 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.