.integrate_beta | R Documentation |
Internal function to integrate the likelihood getting the ΔCq value (the argument del
) over the entire range of the allele ratio (0 to 1). Vectorized for multiple bulk samples. Having the same arguments with .integrate_gamma.
.integrate_beta( del, SHR, SHS, zeroAmount, targetScale, sdMeasure, xsm = 2, EPCR, cubmethod = "hcubature", relTol = 0.1, absTol = 1e-08, maxEval = 10^6 )
del |
Numeric vector of the observed ΔCq values. |
SHR |
The gamma shape parameters for the mutant (R) portion of the bulk samples. Should be the same vector length as del. Each element of SHR is defined as K*(the assumed number of R allele in the bulk sample: 1, 2, 3, ..., n-1). |
SHS |
The gamma shape parameters for the wild (S) portion of the bulk samples. Should be the same length as del. Each element of SHS is defined as K*(the assumed number of S allele in the bulk sample). |
zeroAmount |
(In RED-ΔΔCq method) residue rate of restriction enzyme digestion, or (in general ΔΔCq analyses) small portion of the off-target allele on the target locus of the test sample, which will be amplified in the PCR. It needs to be always specified by the user as a number between 0 and 1, usually near 0. |
targetScale |
(δ_{T}) Scalar. The relative template DNA amount of the target locus to the houskeeping locus. If known, given as a positive numeric. |
sdMeasure |
(σ_{c}) Scalar. The measurement error (standard deviation) on each Cq value following Normal(0, σ_{c}^2). If known, given as a positive numeric. |
xsm |
Specify the accumulation of the standard deviation of the Cq measuring errors when the *-Cq values are fed as difference. For ΔCq values, sdMeasure times two. For ΔΔCq, sdMeasure times four. Default is two and used in most cases. |
EPCR |
(η) Scalar. Amplification efficiency per PCR cycle. If known, given as a positive numeric. When |
cubmethod |
Cubature method passed to the integrator function. See the section "Methods for cubintegrate". |
relTol |
The maximum tolerance passed to the cubature method. Though the default of cubature::cubintegrate function is 1e-5, the accuracy is reduced here to acceralate the integration. |
absTol |
The absolute tolerance passed to the cubature method. The default is 1e-8, which is less accurate than the default of cubintegrate function (1e-12) but considered enough for the estimation. |
maxEval |
Maximum number of function evaluations needed. The default is 10^6, which is same as the cubintegrate default. |
A numeric vector of marginal likelihoods having the same length as del
.
The following methods are available for cubintegrate()
: cubmethod = c("hcubature", "pcubature", "cuhre", "divonne", "suave", "vegas").
hcubature
is considerably fast, but less accurate with larger reltol
. cuhre
is moderately fast and the most accurate in most relTol
range. If you can wait longer, hcubature
with relTol = 1e-4
or cuhre
with relTol = 1e-1
is recommended.
At reltol = 1e-1
, hcubature
is three times faster than cuhre
, but the log-likelihood fluctuate by 0.1 (by 0.001 in cuhre
).
The speed and accuracy of hcubature
at reltol = 1e-5
is comparable with cuhre
at reltol = 1e-1
.
pcubature
and divonne
frequently returns NaN
and are not recommended.
suave
and vegas
are Monte Carlo integration and slow. They are certainly accurate even at reltol = 1
, but interior to cuhre
with same reltol
.
Other integrators:
.integrate_gamma()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.