mcpd {copent} | R Documentation |
Multiple change point detection with copula entropy based two-sample test
Description
Multiple change point detection with copula entropy based two-sample test.
Usage
mcpd(x,maxp=5,thd=0.13,minseglen=10,n=15,k=3,dt=2,ncores=0)
Arguments
x |
data with each row as a sample of d-dimensional random variables |
maxp |
maximal number of change points, default = 5 |
thd |
threshold of the statistic of two-sample test for detecting change points, default = 0.13 |
minseglen |
minimal length of binary segmentation, default = 10 |
n |
the parameter used by two-sample test, default = 15 |
k |
kth nearest neighbour, default = 3 |
dt |
the type of distance between samples, 1 for Eclidean distance; 2 for Maximum distance |
ncores |
number of cores to be used for parallel computing, default = 0 for all the cores |
Details
This program involves detecting multiple change points in univariate or multivariate time series data with copula entropy based two-sample test. It was proposed in Ma (2024). The method is a combination of binary segmentation and single change point detection implemented in cpd
.
The argument x is for the data with each row as a sample of d-dimensional random variables. The argument maxp is for the maximal number of change points. The argument thd is for the threshold of the statistic of two-sample test for detecting a change point used in cpd
. The argument minseglen is for the minimal length of each segment in binary segmentation. If the length of a segment is shorter than minseglen, then no detection will be performed on the segment. The argument k and dt is used in the kNN method for estimating entropy. k is for the kth nearest neighbour (default = 3) and dt is for the type of distance between samples which has currently two value options (1 for Eclidean distance, and 2(default) for Maximum distance). The argument ncores is for the number of cores to be used for parallel computing. If the default 0 is used, then all the cores will be used.
Value
The function returns a list containing
maxstat |
the maximal statistics of the detected change points |
pos |
the change points detected |
References
Ma, Jian. Change Point Detection with Copula Entropy based Two-Sample Test. arXiv preprint arXiv:2403.07892, 2024.
Examples
x = c(rnorm(15,0,1),rnorm(10,0,10),rnorm(10,0,1))
mcpd(x,thd=0.15,ncores=2)