lin_costs: lin_costs

View source: R/RcppExports.R

lin_costsR Documentation

lin_costs

Description

Built matrix of interval costs for held-out linear models. One indexed.

Usage

lin_costs(x, y, w, min_seg, indices)

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).

indices

IntegerVector, ordered list of indices to pair.

Value

xcosts NumericMatix, for j>=i xcosts(i,j) is the cost of partition element [i,...,j] (inclusive).

Examples


lin_costs(c(1, 2, 3, 4), c(1, 2, 2, 1), c(1, 1, 1, 1), 1, 1:4)


RcppDynProg documentation built on Aug. 20, 2023, 9:07 a.m.