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 Fortran lazy; it tends to do better than lazy on flow-like data). This is a Python (numba) port of nrlazy, for a scalar time series. The method is that of

Schreiber, 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 -r option, 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 series

  • fracVarRemoved: 1 - var(denoised) / var(original), the fraction of the variance attributed to noise and removed

  • corrOrigDenoised: the correlation coefficient between the original and denoised series

  • ac1Change: 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 itself

  • fracNoCorrection: 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 whether neighborhood_std was too small for these data)

(meanNeighbors and fracNoCorrection are over the points that have a full embedding vector, samples (m-1)*d + 1 to N; the first (m-1)*d samples are never corrected.) - 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) trajectory

  • KChange: KDenoised minus K of the original series: does removing noise change the chaos verdict for this series?

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 KDenoised and KChange are NaN for shorter series.

Return type:

dict