DYNPROG: Determines the optimal points in a signal to split so as to...

Description Usage Arguments Value Examples

View source: R/DYNPROG.R

Description

Determines the optimal points in a signal to split so as to minimize cost.

Usage

1
DYNPROG(signal, max.segs)

Arguments

signal

The sequence of values to split

max.segs

The maximum number of segments the sequence should be split into

Value

A list which contains the following elements is returned: cost: A max.segs by signal length matrix where the element at position [i,j] is the optimal cost for splitting the signal, up to index j, into i segments. change: A max.segs by max.segs triangular matrix where the element in position [i,j] is the index of the jth optimal changepoint when splitting the whole signal into i segments.

Examples

1
2
3
4
signal <- c( runif(25, min=0, max=2), runif(25, min=2, max=5) )
DYNPROG.fit <- DYNPROG( signal, 10 )
DYNPROG.fit$cost
DYNPROG.fit$change

Benjamin-Couey/CS599.RPackageTwo documentation built on Dec. 31, 2020, 10:45 a.m.