Package 'mscp'

Title: Multiscale Change Point Detection via Gradual Bandwidth Adjustment in Moving Sum Processes
Description: Multiscale moving sum procedure for the detection of changes in expectation in univariate sequences. References - Multiscale change point detection via gradual bandwidth adjustment in moving sum processes (2021+), Tijana Levajkovic and Michael Messer.
Authors: Tijana Levajkovic [aut], Michael Messer [aut, cre]
Maintainer: Michael Messer <[email protected]>
License: GPL-3
Version: 1.0
Built: 2024-11-18 06:34:27 UTC
Source: CRAN

Help Index


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

plot.mscp, summary.mscp

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)

plot.mscp

Description

Plot method for class 'mscp'

Usage

## S3 method for class 'mscp'
plot(x = x, cex = 1, plot.legend = TRUE, ...)

Arguments

x

object of class mscp

cex

numeric, global sizes in plot

plot.legend

logical, if TRUE legends are plotted

...

additional arguments

Value

No return value, called for side effects

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

mscp, summary.mscp

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)

summary.mscp

Description

Summary method for class 'mscp'

Usage

## S3 method for class 'mscp'
summary(object, ...)

Arguments

object

object of class mscp

...

additional arguments

Value

No return value, called for side effects

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

mscp, plot.mscp

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)