pyhctsa.operations.changepoint.wavelet_var_chg

pyhctsa.operations.changepoint.wavelet_var_chg(y, w_name='db3', level=3, max_n_chpts=5, min_delay=0.01)

Number of variance change points found from a wavelet detail signal.

The series is decomposed with a mother wavelet to a given level, and the detail signal at that level is reconstructed. The 2% of its values with the largest magnitude are replaced by the mean of the detail signal, so that single large events do not dominate. A variance change-point estimator (dynamic programming on a Gaussian variance contrast, Lavielle 1999) then finds up to max_n_chpts points at least min_delay samples apart. The number to keep is chosen with a modified BIC (Zhang and Siegmund 2007) on the contrast divided by an estimate of the variance inflation due to the (band-limited) detail signal’s serial dependence, so that stationary series return 0 about 95% of the time. The output is that number.

Parameters:
y : array-like

The input time series.

w_name : str, optional

The name of the mother wavelet to analyze the data with, e.g., ‘db3’, ‘sym2’. Default is ‘db3’.

level : int or 'max', optional

The level of wavelet decomposition; ‘max’ uses the maximum level for the series length. Default is 3.

max_n_chpts : int, optional

The maximum number of change points. Default is 5.

min_delay : float or int, optional

The minimum delay between consecutive change points, in samples; a value between 0 and 1 is taken as a proportion of the time-series length, e.g., 0.02 ensures that change points are separated by at least 2% of the length. Default is 0.01.

Returns:

The optimal number of change points, from 0 to max_n_chpts, or NaN if level is too large for the wavelet on this series.

Return type:

float