powered by
Built matrix of total out of sample interval square error costs for held-out means. One indexed.
const_costs(y, w, min_seg, indices)
xcosts NumericMatix, for j>=i xcosts(i,j) is the cost of partition element [i,...,j] (inclusive).
NumericVector, values to group in order.
NumericVector, weights.
positive integer, minimum segment size (>=1).
IntegerVector, order list of indices to pair.
const_costs(c(1, 1, 2, 2), c(1, 1, 1, 1), 1, 1:4)
Run the code above in your browser using DataLab