Type: | Package |
Title: | Joint Change Point Detection |
Version: | 1.2 |
Date: | 2021-11-06 |
Maintainer: | Michael Messer <michael.messer@tuwien.ac.at> |
Description: | Procedures for joint detection of changes in both expectation and variance in univariate sequences. Performs a statistical test of the null hypothesis of the absence of change points. In case of rejection performs an algorithm for change point detection. Reference - Bivariate change point detection - joint detection of changes in expectation and variance, Scandinavian Journal of Statistics, DOI 10.1111/sjos.12547. |
License: | GPL-3 |
RoxygenNote: | 7.1.2 |
NeedsCompilation: | no |
Packaged: | 2021-11-05 18:16:54 UTC; MichaelMesser |
Author: | Michael Messer [aut, cre] |
Repository: | CRAN |
Date/Publication: | 2021-11-06 15:00:10 UTC |
jcp
Description
Joint change point detection - expectation and variance - via bivariate moving sum statistics
Usage
jcp(x, H = NA, q = NA, alpha = 0.05, sim = 1000, region = "square")
Arguments
x |
numeric vector. Input sequence of random variables. |
H |
NA or numeric vector. Window set. If NA (default), then H is automatically set. If not NA, then H must an increasing vector of positive integers with maximum =< length(x)/2. |
q |
NA or numeric value. Rejection threshold. If NA (default), then the rejection boundary is derived in simulations (from Gaussian process limit) according to sim and alpha. If not NA, then q is considered predefined and must be set a postive real number. |
alpha |
numeric value. Significance level. Must be in (0,1), default = 0.05. In case of predefined q, alpha is set to NA. |
sim |
numeric value. Number of simulations of limit process for approximation of q. Must be positive integer, default = 1000. In case of predefined q, sim is set to NA. |
region |
character string. Defines rejection region, default = "square". Must be chosen either "square", "circle" or "ellipse". |
Value
invisible list
changepoints |
detected change points (increasingly ordered) |
mean_sd |
matrix of estimated means and standard deviations |
M |
test statistic |
q |
rejection threshold |
H |
window set |
sim |
number of simulations of the limit process (approximation of q) |
alpha |
significance level |
region |
rejection region |
method |
derivation of threshold q, either asymptotic or predefined |
x |
input sequence |
EVrho |
list containing the auxiliary processes E, V and correlation rho, for each element of H one list entry |
CP_meta |
matrix containing meta information of estimation. Estimated change points (increasingly ordered), responsible window h, components E, V and rho of joint statistic at estimated change points (regarding responsible window) |
SFA |
detected change points of single filter algorithms |
Author(s)
Michael Messer
References
Michael Messer (2021) Bivariate change point detection - joint detection of changes in expectation and variance, Scandinavian Journal of Statistics, DOI 10.1111/sjos.12547.
See Also
Examples
# Normal distributed sequence with 3 change points at
# c1=250 (change in expectation),
# c2=500 (change in variance) and
# c3=750 (change in expectation and variance)
set.seed(0)
m <- c(8,10,10,3); s <- c(4,4,10,5)
x <- rnorm(1000, mean=rep(m,each=250), sd=rep(s,each=250))
result <- jcp(x)
summary(result)
plot(result)
# Set additional parameters (window set)
result2 <- jcp(x,H=c(80,160,240))
summary(result2)
plot(result2)
plot.jcp
Description
Plot method for class 'jcp'
Usage
## S3 method for class 'jcp'
plot(x, cex = 1, cex.main = 1, ...)
Arguments
x |
object of class jcp |
cex |
numeric, global sizes in plot |
cex.main |
numeric, size of titles |
... |
additional arguments |
Value
No return value, called for side effects
Author(s)
Michael Messer
References
Michael Messer (2021) Bivariate change point detection - joint detection of changes in expectation and variance, Scandinavian Journal of Statistics, DOI 10.1111/sjos.12547.
See Also
Examples
# Normal distributed sequence with 3 change points at
# c1=250 (change in expectation),
# c2=500 (change in variance) and
# c3=750 (change in expectation and variance)
set.seed(0)
m <- c(8,10,10,3); s <- c(4,4,10,5)
x <- rnorm(1000, mean=rep(m,each=250), sd=rep(s,each=250))
result <- jcp(x)
summary(result)
plot(result)
# Set additional parameters (window set)
result2 <- jcp(x,H=c(80,160,240))
summary(result2)
plot(result2)
summary.jcp
Description
Summary method for class 'jcp'
Usage
## S3 method for class 'jcp'
summary(object, ...)
Arguments
object |
object of class jcp |
... |
additional arguments |
Value
No return value, called for side effects
Author(s)
Michael Messer
References
Michael Messer (2021) Bivariate change point detection - joint detection of changes in expectation and variance, Scandinavian Journal of Statistics, DOI 10.1111/sjos.12547.
See Also
Examples
#' # Normal distributed sequence with 3 change points at
# c1=250 (change in expectation),
# c2=500 (change in variance) and
# c3=750 (change in expectation and variance)
set.seed(0)
m <- c(8,10,10,3); s <- c(4,4,10,5)
x <- rnorm(1000, mean=rep(m,each=250), sd=rep(s,each=250))
result <- jcp(x)
plot(result)
summary(result)
# Set additional parameters (window set)
result2 <- jcp(x,H=c(80,160,240))
plot(result2)
summary(result2)