Change-in-Slope OP Algorithm with a Finite Number of States //
Optimal partitioning algorithm for change-in-slope problem with
continuity constraint and a finite number of states. Some
constraints can be enforced in the inference: isotonic,
unimodal or smoothing. With the function slopeSN() (segment
neighborhood) the number of segments to infer is fixed by the
user and does not depend on a penalty value.