findSegments {tilingArray}R Documentation

Fit a piecewise constant curve to a sequence of numbers

Description

The function fits a piecewise constant curve to a sequence of numbers using a simple least squares cost function and the dynamic programming algorithm of Picard et al. (full citation see below).

Usage

findSegments(x, maxcp, maxk, verbose=0)

Arguments

x Numeric (real) vector.
maxcp Integer (length 1): maximum number of segments (= 1 + maximum number of change points).
maxk Integer (length 1): maximum length of a segment.
verbose Integer (length 1): if this parameter has a positive value, various diagnostic output is printed.

Details

The complexity of the algorithm is length(x)*maxk in memory and length(x)*maxk*maxcp in time.

Value

A list with two elements J and th. See the vignette, and the paper cited below for details.

Author(s)

W. Huber <huber@ebi.ac.uk>

References

A statistical approach for CGH microarray data analysis. Franck Picard, Stephane Robin, Marc Lavielle, Christian Vaisse, Gilles Celeux, Jean-Jacques Daudin, Rapport de recherche No. 5139, Mars 2004, Institut National de Recherche en Informatique et en Automatique (INRIA), ISSN 0249-6399. The code of this function is based on the Matlab implementation presented at verb+http://www.inapg.fr/ens_rech/mathinfo/recherche/mathematique/outil.html+, but it has evolved.

Examples

 x = rep( sin((0:4)/2*pi), each=3) + rnorm(3*5, sd=0.1)
 res = findSegments(x, maxcp=6, maxk=15)

[Package tilingArray version 1.0.2 Index]