Calculate logistic cost of using mean of points to estimate other points in interval. Zero indexed.
const_cost_logistic(y, w, min_seg, i, j)
y | NumericVector, 0/1 values to group in order (should be in interval [0,1]). |
---|---|
w | NumericVector, weights (should be positive). |
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).
#> [1] -1.721453