const_cost_logistic: const_cost_logistic

View source: R/RcppExports.R

const_cost_logisticR Documentation

const_cost_logistic

Description

Calculate logistic cost of using mean of points to estimate other points in interval. Zero indexed.

Usage

const_cost_logistic(y, w, min_seg, i, j)

Arguments

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

Value

scalar, const cost of [i,...,j] interval (inclusive).

Examples


const_cost_logistic(c(0.1, 0.1, 0.2, 0.2), c(1, 1, 1, 1), 1, 0, 3)


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