anotherBkp: Get best candidate change point

Description Usage Arguments Details Author(s) Examples

Description

Get best candidate change point according to binary segmentation

Usage

1
anotherBkp(Y, weightFUN = defaultWeights, verbose = FALSE)

Arguments

Y

A n*p matrix, p signals of length n to be segmented (centered by column)

weightFUN

A function returning a (n-1)*1 vector of weights for the candidate change point positions. Default weights yield the likelihood ratio test (LRT) statistic for the identification of a single change point.

verbose

A logical value: should extra information be output ? Defaults to FALSE.

Details

Contrary to oneBkp, anotherBkp handles missing values (NA:s).

Author(s)

Morgane Pierre-Jean and Pierre Neuvial

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
p <- 2
n <- 100

sim <- randomProfile(n, 1, 1, p)
Y <- sim$profile
bkp <- anotherBkp(Y)
print(bkp)
print(oneBkp(Y))
##  stopifnot(identical(oneBkp(Y), bkp))
plotSeg(Y, list(sim$bkp, bkp))

## robustness to NA:s
h <- 2
idxs <- seq(from=max(sim$bkp[1]-h, 1), min(sim$bkp[1]+h, n))
Y[idxs, p] <- NA
oneBkp(Y)  ## does not work
bkp <- anotherBkp(Y)  ## works
bkp-sim$bkp


Search within the jointseg package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.