mosum | R Documentation |
Computes the MOSUM detector, detects (multiple) change points and estimates their locations.
mosum( x, G, G.right = G, var.est.method = c("mosum", "mosum.min", "mosum.max", "custom")[1], var.custom = NULL, boundary.extension = TRUE, threshold = c("critical.value", "custom")[1], alpha = 0.1, threshold.custom = NULL, criterion = c("eta", "epsilon")[1], eta = 0.4, epsilon = 0.2, do.confint = FALSE, level = 0.05, N_reps = 1000 )
x |
input data (a |
G |
an integer value for the moving sum bandwidth;
|
G.right |
if |
var.est.method |
how the variance is estimated; possible values are
|
var.custom |
a numeric vector (of the same length as |
boundary.extension |
a logical value indicating whether the boundary values should be filled-up with CUSUM values |
threshold |
string indicating which threshold should be used to determine significance.
By default, it is chosen from the asymptotic distribution at the given significance level |
alpha |
a numeric value for the significance level with
|
threshold.custom |
a numeric value greater than 0 for the threshold of significance;
use iff |
criterion |
string indicating how to determine whether each point
|
eta |
a positive numeric value for the minimal mutual distance of
changes, relative to moving sum bandwidth (iff |
epsilon |
a numeric value in (0,1] for the minimal size of exceeding
environments, relative to moving sum bandwidth (iff |
do.confint |
flag indicating whether to compute the confidence intervals for change points |
level |
use iff |
N_reps |
use iff |
S3 object of class mosum.cpts
, which contains the following fields:
x |
input data |
G.left, G.right |
left and right summation bandwidths |
var.est.method, var.custom,boundary.extension |
input parameters |
stat |
a series of MOSUM statistic values; the first |
rollsums |
a series of MOSUM detector values; equals |
var.estimation |
the local variance estimated according to |
threshold, alpha, threshold.custom |
input parameters |
threshold.value |
threshold value of the corresponding MOSUM test |
criterion, eta, epsilon |
input parameters |
cpts |
a vector containing the estimated change point locations |
cpts.info |
data frame containing information about change point estimators including detection bandwidths, asymptotic p-values for the corresponding MOSUM statistics and (scaled) size of jumps |
do.confint |
input parameter |
ci |
S3 object of class |
A. Meier, C. Kirch and H. Cho (2021) mosum: A Package for Moving Sums in Change-point Analysis. Journal of Statistical Software, Volume 97, Number 8, pp. 1-42. <doi:10.18637/jss.v097.i08>.
B. Eichinger and C. Kirch (2018) A MOSUM procedure for the estimation of multiple random change-points. Bernoulli, Volume 24, Number 1, pp. 526-564.
H. Cho and C. Kirch (2022) Bootstrap confidence intervals for multiple change points based on moving sum procedures. Computational Statistics & Data Analysis, Volume 175, pp. 107552.
x <- testData(lengths = rep(100, 3), means = c(0, 5, -2), sds = rep(1, 3), seed = 1234)$x m <- mosum(x, G = 40) plot(m) summary(m)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.