Skip to contents

Compute the monotone cost,

Usage

monotone_cost(x, s = NULL, eps = 1, increasing = TRUE)

Arguments

x

numeric vector representing the density of a histogram

s

numeric vector representing initial segmentation indices

eps

numeric hyperparameter epsilon used to scale the resolution of segmentation

increasing

logical, whether the Grenander estimator should assume x is increasing or decreasing

Value

numeric, monotone cost