Find variance change points
[PTS_OPT,KOPT,T_EST] = wvarchg(Y,K,D)
[PTS_OPT,KOPT,T_EST] = wvarchg(Y,K,D) computes
estimated variance change points for the signal
j change points, with j = 0, 1, 2, ... ,
D is the minimum delay between two
KOPT is the proposed number of change
points (0 ≤
PTS_OPT contains the corresponding change
k instants of the variance change points and
KOPT > 0,
PTS_OPT = T_EST(KOPT+1,1:KOPT) else
D must be integers
such that 1 <
K << length(
and 1 ≤
D << length(
Y should be zero mean.
wvarchg(Y,K) is equivalent to
wvarchg(Y) is equivalent to
Add two variance change points to the blocks signal. Detect the variance change points using
Load the blocks signal. Add white noise with two variance change points located at index 180 and 600.
x = wnoise(1,10); rng default; bb = 1.5*randn(1,length(x)); cp1 = 180; cp2 = 600; x = x + [bb(1:cp1),bb(cp1+1:cp2)/4,bb(cp2+1:end)];
Obtain the level-1 wavelet coefficients. Replace the top 2% of values with the mean value of the wavelet coefficients to remove all signal.
wname = 'db3'; lev = 1; [c,l] = wavedec(x,lev,wname); det = wrcoef('d',c,l,wname,1); y = sort(abs(det)); v2p100 = y(fix(length(y)*0.98)); ind = find(abs(det)>v2p100); det(ind) = mean(det);
Estimate the variance change points using the wavelet coefficients.
[pts_Opt,kopt,t_est] = wvarchg(det,5); sprintf('The estimated change points are %d and %d\n',pts_Opt)
ans = The estimated change points are 181 and 601
Lavielle, M. (1999), "Detection of multiple changes in a sequence of dependent variables," Stoch. Proc. and their Applications, 83, 2, pp. 79–102.