const_costs: const_costs

View source: R/RcppExports.R

const_costsR Documentation

const_costs

Description

Built matrix of total out of sample interval square error costs for held-out means. One indexed.

Usage

const_costs(y, w, min_seg, indices)

Arguments

y

NumericVector, values to group in order.

w

NumericVector, weights.

min_seg

positive integer, minimum segment size (>=1).

indices

IntegerVector, order list of indices to pair.

Value

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

Examples


const_costs(c(1, 1, 2, 2), c(1, 1, 1, 1), 1, 1:4)


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