get_complexity_best_optimal_cost {binsegRcpp} | R Documentation |
get complexity best optimal cost
Description
Dynamic programming for computing lower bound on number of split candidates to compute / best case of binary segmentation. The dynamic programming recursion is on f(d,s) = best number of splits for segment of size s which is split d times. Need to optimize f(d,s) = g(s) + min f(d1,s1) + f(d2,s2) over s1,d1 given that s1+s2=s, d1+d2+1=d, and g(s) is the number of splits for segment of size s.
Usage
get_complexity_best_optimal_cost(N.data,
min.segment.length = 1L,
n.segments = NULL)
Arguments
N.data |
positive integer number of data. |
min.segment.length |
positive integer min segment length. |
n.segments |
positive integer number of segments. |
Value
data table with one row for each f(d,s) value computed.
Author(s)
Toby Dylan Hocking <toby.hocking@r-project.org> [aut, cre]
Examples
binsegRcpp::get_complexity_best_optimal_cost(
N.data = 19L,
min.segment.length = 3L,
n.segments = 4L)
[Package binsegRcpp version 2025.5.13 Index]