Title: | Backward Procedure for Change-Point Detection |
---|---|
Description: | Implements a backward procedure for single and multiple change point detection proposed by Shin et al. <arXiv:1812.10107>. The backward approach is particularly useful to detect short and sparse signals which is common in copy number variation (CNV) detection. |
Authors: | Seung Jun Shin [aut, cre], Yichao Wu [aut], Ning Hao [aut] |
Maintainer: | Seung Jun Shin <[email protected]> |
License: | GPL-2 |
Version: | 0.1.0 |
Built: | 2024-12-19 06:50:29 UTC |
Source: | CRAN |
Implements backward procedure for detecting single or multiple change points.
bwd(y, alpha = 0.05, kmin = 3, lastkgroup = floor(0.01 * n), mu0 = NULL, normal = T, n.permute = 1000, h = 10)
bwd(y, alpha = 0.05, kmin = 3, lastkgroup = floor(0.01 * n), mu0 = NULL, normal = T, n.permute = 1000, h = 10)
y |
observed data |
alpha |
target level that detemines stopping criterion. Default is 0.05 |
kmin |
minimum length of segements for checking possible change points |
lastkgroup |
We can abvoid chekcing possible change points when we have less groups than "lastkgroup" to improve computational efficiency. Default is 0.01 * n |
mu0 |
Baseline mean value whe detecting epidemic chang points. Defalut is |
normal |
if |
n.permute |
number of permutation when computing the permuted cutoff. Defalut is 1000 |
h |
bandwidth size for variance esitimator |
bwd object that contains information of detected segments and significance levels
Seung Jun Shin, Yicaho Wu, Ning Hao
Shin, Wu, and Hao (2018+) A backward procedure for change-point detection with applications to copy number variation detection, arXiv:1812.10107.
# simulated data set.seed(1) n <- 1000 L <- 10 mu0 <- -0.5 mu <- rep(mu0, n) mu[(n/2 + 1):(n/2 + L)] <- mu0 + 1.6 mu[(n/4 + 1):(n/4 + L)] <- mu0 - 1.6 y <- mu + rnorm(n) alpha <- c(0.01, 0.05) # BWD obj1 <- bwd(y, alpha = alpha) # Modified for epidemic changes with a known basline mean, mu0. obj2 <- bwd(y, alpha = alpha, mu0 = 0) par(mfrow = c(2,1)) plot(obj1, y) plot(obj2, y)
# simulated data set.seed(1) n <- 1000 L <- 10 mu0 <- -0.5 mu <- rep(mu0, n) mu[(n/2 + 1):(n/2 + L)] <- mu0 + 1.6 mu[(n/4 + 1):(n/4 + L)] <- mu0 - 1.6 y <- mu + rnorm(n) alpha <- c(0.01, 0.05) # BWD obj1 <- bwd(y, alpha = alpha) # Modified for epidemic changes with a known basline mean, mu0. obj2 <- bwd(y, alpha = alpha, mu0 = 0) par(mfrow = c(2,1)) plot(obj1, y) plot(obj2, y)
A plot of segments estimated by the backward procedure.
## S3 method for class 'bwd' plot(x, y, ...)
## S3 method for class 'bwd' plot(x, y, ...)
x |
bwd object |
y |
observed data |
... |
graphical parameters |
plot of estimated segments
Seung Jun Shin, Yicaho Wu, Ning Hao
Shin, Wu, and Hao (2018+) A backward procedure for change-point detection with applications to copy number variation detection, arXiv:1812.10107.
# simulated data set.seed(1) n <- 1000 L <- 10 mu0 <- -0.5 mu <- rep(mu0, n) mu[(n/2 + 1):(n/2 + L)] <- mu0 + 1.6 mu[(n/4 + 1):(n/4 + L)] <- mu0 - 1.6 y <- mu + rnorm(n) alpha <- c(0.01, 0.05) # BWD obj1 <- bwd(y, alpha = alpha) # Modified for epidemic changes with a known basline mean, mu0. obj2 <- bwd(y, alpha = alpha, mu0 = 0) par(mfrow = c(2,1)) plot(obj1, y) plot(obj2, y)
# simulated data set.seed(1) n <- 1000 L <- 10 mu0 <- -0.5 mu <- rep(mu0, n) mu[(n/2 + 1):(n/2 + L)] <- mu0 + 1.6 mu[(n/4 + 1):(n/4 + L)] <- mu0 - 1.6 y <- mu + rnorm(n) alpha <- c(0.01, 0.05) # BWD obj1 <- bwd(y, alpha = alpha) # Modified for epidemic changes with a known basline mean, mu0. obj2 <- bwd(y, alpha = alpha, mu0 = 0) par(mfrow = c(2,1)) plot(obj1, y) plot(obj2, y)