OrderKmeans {offlineChange} | R Documentation |
Detect the location of change points based on minimizing within segment quadratic loss with fixed number of change points.
OrderKmeans(x, K = 4, num_init = 10)
x |
The data to find change points with dimension N x D, must be matrix |
K |
The number of change points. |
num_init |
The number of repetition times, in order to avoid local minimal. Default is squared root of number of observations. Must be integer. |
The K change points form K+1 segments (1 2 ... change_point(1)) ... (change_point(K) ... N).
wgss_sum |
total within segment sum of squared distances to the segment mean (wgss) of all segments. |
num_each |
number of observations of each segment |
wgss |
total wgss of each segment. |
change_point |
location of optimal change points. |
J. Ding, Y. Xiang, L. Shen, and V. Tarokh, Multiple Change Point Analysis: Fast Implementation and Strong Consistency. IEEE Transactions on Signal Processing, vol. 65, no. 17, pp. 4495-4510, 2017.
a<-matrix(rnorm(40,mean=-1,sd=1),nrow=20,ncol=2) b<-matrix(rnorm(120,mean=0,sd=1),nrow=60,ncol=2) c<-matrix(rnorm(40,mean=1,sd=1),nrow=20,ncol=2) x<-rbind(a,b,c) OrderKmeans(x,K=3) OrderKmeans(x,K=3,num_init=8)