Multiscale MOSUM procedure with (possibly) assymetric bandwidths and localised pruning based on Schwarz criterion.
multiscale.localPrune(
x,
G = bandwidths.default(length(x)),
max.unbalance = 4,
threshold = c("critical.value", "custom")[1],
alpha = 0.1,
threshold.function = NULL,
criterion = c("eta", "epsilon")[1],
eta = 0.4,
epsilon = 0.2,
rule = c("pval", "jump")[1],
penalty = c("log", "polynomial")[1],
pen.exp = 1.01,
do.confint = FALSE,
level = 0.05,
N_reps = 1000,
...
)
S3 object of class multiscale.cpts
, which contains the following fields:
input data
estimated change points
data frame containing information about estimated change points
Schwarz criterion values of the estimated change point set
set of change point candidates that have been considered by the algorithm
input parameter
input parameters
input parameters
input parameters
input parameter
object of class cpts.ci
containing confidence intervals for change points iff do.confint = TRUE
input data (a numeric
vector or an object of classes ts
and timeSeries
)
a vector of bandwidths, given as either integers less than length(x)/2
,
or numbers between 0
and 0.5
describing the moving sum bandwidths relative to length(x)
.
Asymmetric bandwidths obtained as the Cartesian product of the set G
with itself are used for change point analysis
a numeric value for the maximal ratio between maximal and minimal bandwidths to be used for candidate generation,
1 <= max.unbalance <= Inf
string indicating which threshold should be used to determine significance.
By default, it is chosen from the asymptotic distribution at the significance level alpha
.
Alternatively, it is possible to parse a user-defined function with threshold.function
a numeric value for the significance level with
0 <= alpha <= 1
. Use iff threshold = "critical.value"
function object of form function(G_l, G_r, length(x), alpha)
, to compute a
threshold of significance for different bandwidths (G_l, G_r)
; use iff threshold = "custom"
how to determine whether an exceeding point is a change point; to be parsed to mosum
see mosum
string for the choice of sorting criterion for change point candidates in merging step. Possible values are:
"pval"
smallest p-value
"jump"
largest (rescaled) jump size
string specifying the type of penalty term to be used in Schwarz criterion; possible values are:
"log"
use penalty = log(length(x))^pen.exp
"polynomial"
use penalty = length(x)^pen.exp
exponent for the penalty term (see penalty
);
flag indicating whether confidence intervals for change points should be computed
use iff do.confint = TRUE
; a numeric value (0 <= level <= 1
) with which
100(1-level)%
confidence interval is generated
use iff do.confint = TRUE
; number of bootstrap replicates to be generated
further arguments to be parsed to mosum calls
See Algorithm 2 in the first referenced paper for a comprehensive description of the procedure and further details.
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>.
H. Cho and C. Kirch (2022) Two-stage data segmentation permitting multiscale change points, heavy tails and dependence. Annals of the Institute of Statistical Mathematics, Volume 74, Number 4, pp. 653-684.
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(model = "mix", seed = 123)$x
mlp <- multiscale.localPrune(x, G = c(8, 15, 30, 70), do.confint = TRUE)
print(mlp)
summary(mlp)
par(mfcol=c(2, 1), mar = c(2, 4, 2, 2))
plot(mlp, display = "data", shaded = "none")
plot(mlp, display = "significance", shaded = "CI", CI = "unif")
Run the code above in your browser using DataLab