lin_cost: lin_cost

Description Usage Arguments Value Examples

View source: R/RcppExports.R

Description

Calculate cost of using linear model fit on points to estimate other points in the interval. Zero indexed.

Usage

1
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

1
lin_cost(c(1, 2, 3, 4), c(1, 2, 2, 1), c(1, 1, 1, 1), 1, 0, 3)

RcppDynProg documentation built on Dec. 16, 2020, 1:09 a.m.