MomentEst_MixedBetaBinom.Rd
MomentEst_MixedBetaBinom
calculates moment estimates for the pi- and theta-parameters of the beta-binomial data,
given data with a varying number of observations. This estimator was previously described by (Kleinman 1973)
,
but was adapted into a weighted (according to how likely a sample is to be homozygous reference, homozygous variant, or
heterozygous) estimator to be used in an expectation-maximization-framework. Due to the varying number of observations, this moment estimate
is actually rather tricky should incorporate an additional per-sample weight that is to be tuned via an iterative procedure,
but given this function's aim is just obtaining a rough estimate as starting point for numerical expectation maximization,
these weights are all set at one (which corresponds to the ideal weights in case the true theta equals zero).
MomentEst_MixedBetaBinom(
ref_counts,
var_counts,
spr,
spv,
sprv,
pi_hom_fix = NULL,
pi_het_fix = NULL
)
Numeric vector. Reference counts.
Numeric vector. Variant counts.
Numeric vector. Chances for samples to be reference homozygotes
Numeric vector. Chances for samples to be variant homozygotes
Numeric vector. Chances for samples to be heterozygotes
Number. If set to a value, fixes the pi-parameter of the homozygous peaks instead of generating a moment estimate; this is an option because the moment estimate of the theta-parameter depends on the pi-parameter.
Number. If set to a value, fixes the pi-parameter of the heterozygous peak instead of generating a moment estimate; this is an option because the moment estimate of the theta-parameter depends on the pi-parameter.
A named vector containing moment estimates of the pi- and theta-parameters for both the homozygous and heterozygous peaks.
Kleinman JC (1973). “Proportions with extraneous variance: single and independent samples.” Journal of the American Statistical Association, 68(341), 46--54.