const_cost | R Documentation |
Calculate out of sample total square error cost of using mean of points to estimate other points in interval. Zero indexed.
const_cost(y, w, min_seg, i, j)
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); |
scalar, const cost of [i,...,j] interval (inclusive).
const_cost(c(1, 1, 2, 2), c(1, 1, 1, 1), 1, 0, 3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.