Description Usage Arguments Value Examples
Optimal partitioning algorithm for change-in-slope problem with a finite number of states (beginning and ending values of each segment is restricted to a finite set of values called states). The algorithm takes into account a continuity constraint between successive segments and infers a continuous piecewise linear signal.
1 2 |
data |
vector of data to segment: a univariate time series |
states |
vector of states = set of accessible starting/ending values for segments in increasing order. |
penalty |
the penalty value (a non-negative real number) |
constraint |
string defining a constraint : "null", "isotonic", "unimodal" or "smoothing" |
minAngle |
a minimal inner angle in degree between consecutive segments in case constraint = "smoothing" |
type |
string defining the pruning type to use. "null" = no pruning, "channel" = use monotonicity property, "pruning" = pelt-type property |
testMode |
a boolean, if true the function also returns the percent of elements to scan (= ratio scanned elements vs. scanned elements if no pruning) |
a list of 3 elements = (changepoints, states, globalCost). (Pruning is optional)
changepoints
is the vector of changepoints (we return the extremal values of all segments from left to right)
states
is the vector of successive states. states[i] is the value we inferred at position changepoints[i]
globalCost
is a number equal to the global cost of the non-penalized change-in-slope problem. That is the value of the fit to the data ignoring the penalties for adding changes
is the percent of positions to consider in cost matrix Q (returned only if testMode = TRUE)
1 2 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.