This R implementation is maintained for debugging and testing
Rcpp code against expected results. If test==TRUE
the
Delta of the recursion is additionally calculated directly
(very inefficiently) to compare results with an explicitly correct
calculation. This can also be useful when testing
potential functions that can yield large numbers and thereby cause
rounding errors.
1 2 3 4 5 6 7 8 9 | consensus_r(
b,
n,
w,
e = function(L, n) L^2/2,
store = FALSE,
test = FALSE,
rel.tol = 1e-08
)
|
b |
list of breakpoints of different segmentations. |
n |
total sequence length ( |
w |
weights vector, must sum up to 1 or will be normalized. |
e |
potential function, taking two arguments: the length |
store |
for debugging: store and return all internal vectors. |
test |
for debugging: calculate Delta directly without using delta helpers. This is very slow but straightforward to implement, the resulting Delta is tested against the Delta of the fast implementation, and results can be used to test other implementations (eg. in Rcpp). |
rel.tol |
relative error tolerance to report and count differences
in Delta during test mode ( |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.