Learn R Programming

jointseg (version 1.0.2)

oneBkp: Get best candidate change point

Description

Get best candidate change point according to binary segmentation

Usage

oneBkp(Y, weights = NULL, verbose = FALSE)

Arguments

Y

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

weights

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.

Examples

Run this code
# NOT RUN {
p <- 2
sim <- randomProfile(1e4, 1, 1, p)
Y <- sim$profile
bkp <- jointseg:::oneBkp(Y)
par(mfrow=c(p,1))
for (ii in 1:p) {
    plot(Y[, ii], pch=19, cex=0.2)
    abline(v=bkp, col=3)
    abline(v=sim$bkp, col=8, lty=2)
}

# }

Run the code above in your browser using DataLab