pyhctsa.operations.pre_process.preproc_schreiber_denoise¶
-
pyhctsa.operations.pre_process.preproc_schreiber_denoise(y, m=
5, d=1, num_iter=1, neighborhood_std=0.5)¶ Nonlinear noise reduction, and how it changes the series.
Applies Schreiber’s simple nonlinear noise-reduction method, replacing each embedded point by the average of its state-space neighbors, as TISEAN’s
nrlazy(a C reimplementation that corrects the whole embedding vector, of the original single-component-correcting Fortranlazy; it tends to do better thanlazyon flow-like data). This is a Python (numba) port ofnrlazy, for a scalar time series. The method is that ofSchreiber, T. “Extremely simple nonlinear noise reduction method”, Phys. Rev. E 47, 2401 (1993).
It is the first stage of the pipeline of Toker et al., used for diagnosing oversampling and for classifying chaos with the 0-1 test.
Denoising is not itself a scalar feature, so this function reports how several properties of the series change as a result of applying it.
- Parameters:¶
- y : array-like¶
The input time series.
- m : int, optional¶
The embedding dimension (nrlazy
-m). Default is 5.- d : int, optional¶
The embedding delay (nrlazy
-d). Default is 1.- num_iter : int, optional¶
The number of correction passes (nrlazy
-i). More iterations denoise more aggressively but risk distorting real dynamics; TISEAN’s own default, and most published use, is 1.- neighborhood_std : float, optional¶
The neighborhood radius in units of the standard deviation of the data (nrlazy
-v; scale-invariant, unlike the raw-roption, which is a fixed fraction of the data interval). Default is 0.5.
- Returns:¶
rmsCorrection: the root-mean-square size of the correction made to the seriesfracVarRemoved: 1 - var(denoised) / var(original), the fraction of the variance attributed to noise and removedcorrOrigDenoised: the correlation coefficient between the original and denoised seriesac1Change: the lag-1 autocorrelation of the denoised series minus that of the original (denoising should smooth the series, increasing it)meanNeighbors: the mean number of neighbors per point found by nrlazy, counting the point itselffracNoCorrection: the fraction of points with a neighbor count of 1, that is, with no neighbors besides themselves, so that no correction was possible there (diagnoses whetherneighborhood_stdwas too small for these data)KDenoised: the statistic K of the 0-1 test for chaos (zero_one_test) computed on the denoised series, since measurement noise inflates the apparent diffusion of the test’s (p, q) trajectoryKChange:KDenoisedminus K of the original series: does removing noise change the chaos verdict for this series?
(
meanNeighborsandfracNoCorrectionare over the points that have a full embedding vector, samples(m-1)*d + 1toN; the first(m-1)*dsamples are never corrected.)All values are NaN if the series is too short for the embedding, or if nrlazy cannot process it (a constant series). The 0-1 test needs at least 200 samples, so
KDenoisedandKChangeare NaN for shorter series.- Return type:¶
dict