lin_cost {RcppDynProg} | R Documentation |
lin_cost
Description
Calculate cost of using linear model fit on points to estimate other points in the interval. Zero indexed.
Usage
lin_cost(x, y, w, min_seg, i, j)
Arguments
x |
NumericVector, x-coords of values to group. |
y |
NumericVector, values to group in order. |
w |
NumericVector, weights. |
min_seg |
positive integer, minimum segment size (>=1). |
i |
integer, first index (inclusive). |
j |
integer, j>=i last index (inclusive); |
Value
scalar, linear cost of [i,...,j] interval (inclusive).
Examples
lin_cost(c(1, 2, 3, 4), c(1, 2, 2, 1), c(1, 1, 1, 1), 1, 0, 3)
[Package RcppDynProg version 0.2.1 Index]