Skip to contents

Computes a piecewise-linear convex minorant of two numeric vectors G and Q by iteratively identifying minimum slopes and assigning them to the output vector y. This method is sometimes used in isotonic or shape-constrained regression contexts.

Usage

CM(G, Q)

Arguments

G

Numeric vector of \(x\)-coordinates (must be the same length as Q).

Q

Numeric vector of \(y\)-coordinates (must be the same length as G).

Value

A numeric vector y of length length(G), giving the slopes or values associated with the convex minorant.

Details

Internally, the function calculates slopes for segments between points in G and picks the minimum slope iteratively, ensuring the resulting piecewise-linear function is convex.