Wavelet Toolbox |
Syntax
[PTS_OPT,KOPT,T_EST] = wvarchg(Y,K,D) [PTS_OPT,KOPT,T_EST] = wvarchg(Y,K) [PTS_OPT,KOPT,T_EST] = wvarchg(Y)
Description
[PTS_OPT,KOPT,T_EST] = wvarchg(Y,K,D) computes the estimated change points of the variance of signal Y for j change points, with j = 0, 1, 2, ... , K.
Integer D is the minimum delay between two change points.
Integer KOPT is the proposed number of change points (0 KOPT K). The vector PTS_OPT contains the corresponding change points.
For 1 k K, T_EST(k+1,1:k) contains the k instants of the variance change points and then, if KOPT > 0, PTS_OPT = T_EST(KOPT+1,1:KOPT) else PTS_OPT = [].
K and D must be integers such that 1 < K << length(Y) and 1 D << length(Y).
The signal Y should be zero mean.
wvarchg(Y,K) is equivalent to wvarchg(Y,K,10).
wvarchg(Y) is equivalent to wvarchg(Y,6,10).
Examples
% Generate signal from a fixed design regression model % with two change points in the noise variance located % at positions 200 and 600. % Generate block test function. x = wnoise(1,10); % Generate noisy blocks with change points. init = 2055615866; randn('seed',init); bb = randn(1,length(x)); cp1 = 200; cp2 = 600; x = x + [bb(1:cp1),bb(cp1+1:cp2)/3,bb(cp2+1:end)]; % The aim of this example is to recover the two % change points in signal x. % In addition, this example illustrates how the GUI % tools propose change point locations for interval % dependent de-noising thresholds. % 1. Recover a noisy signal by suppressing an % approximation. % Perform a single-level wavelet decomposition % of the signal using db3. wname = 'db3'; lev = 1; [c,l] = wavedec(x,lev,wname); % Reconstruct detail at level 1. det = wrcoef('d',c,l,wname,1); % 2. Replace 2% of the biggest values by the mean % in order to remove almost all the signal. x = sort(abs(det)); v2p100 = x(fix(length(x)*0.98)); ind = find(abs(det)>v2p100); det(ind) = mean(det); % 3. Use wvarchg for estimating the change points with % the following parameters. % - the minimum delay between two change points d = 10. % - the maximum number of change points is 5. [pts_Opt,kopt,t_est] = wvarchg(det,5) pts_Opt = 199 601 kopt = 2 t_est = 1024 0 0 0 0 0 601 1024 0 0 0 0 199 601 1024 0 0 0 199 261 601 1024 0 0 207 235 261 601 1024 0 207 235 261 393 601 1024 % Estimated change points are close to the true change % points [200,600].
References
Lavielle, M. (1999), "Detection of multiple changes in a sequence of dependent variables," Stoch. Proc. and their Applications, 83, 2, pp. 79-102.
wtreemgr | GUI Reference |
© 1994-2005 The MathWorks, Inc.