mscp {mscp} | R Documentation |
mscp
Description
Multiscale change point detection via gradual bandwidth adjustment in moving sum processes. A method for the detection of changes in the expectation in univariate sequences.
Usage
mscp(x, delta = 20, g = 20, kappa = NA, alpha = 0.01, sim = 500)
Arguments
x |
numeric vector. Input sequence of random variables. |
delta |
integer >=2. Default = 20. Minimal window considered. |
g |
integer >=1. Default = 20. Spacing between starting points. |
kappa |
NA or positive real number. Default = NA. Breaking threshold. If NA, then kappa is derived in simulations, using alpha and sim |
alpha |
numeric in (0,1). Default = 0.01. Significance level, i.e., sets kappa as (1-alpha)-quantile of maximum of Gaussian process limit. |
sim |
integer >=1. Default = 500. Number of simulations for kappa. |
Value
invisible list
cp |
detected change points (ordered according to detection) |
mean_sd |
matrix of estimated means and standard deviations |
path |
list containing matrices, each matrix describing the path of a detected change point. First column: t-value, second column: h-value, third column: D-value (statistic), first row: starting values, last row: end values |
S |
matrix of possible starting values. First column: t-value, second column: h-value, third column: D-value (statistic), fourth column: step when cut out |
x |
input sequence |
delta |
minimal window size |
g |
spacing between starting points |
kappa |
threshold |
Author(s)
Tijana Levajkovic and Michael Messer
References
Multiscale change point detection via gradual bandwidth adjustment in moving sum processes (2021+), Tijana Levajkovic and Michael Messer
See Also
Examples
set.seed(1)
Tt <- 1000
cp <- c(250,500,600,650,750)
mu <- c(2,3,6,9,12,15)
sd <- c(1,1,2,1,2,1)
m <- rep(mu,diff(c(0,cp,Tt)))
s <- rep(sd,diff(c(0,cp,Tt)))
x <- rnorm(Tt,m,s)
result <- mscp(x,kappa=4.77) # kappa set manually
# result <- mscp(x) # kappa derived in simulations
summary(result)
plot(result)