Statistical tests
Whitenoise check
- PyEMD.checks.whitenoise_check(IMFs: ndarray, test_name: str = 'aposteriori', rescaling_imf: int = 1, alpha: float = 0.95)[source]
Whitenoise statistical significance test.
Performs whitenoise test as described by Wu & Huang [Wu2004].
- Parameters:
- IMFs: np.ndarray
(Required) numpy array containing IMFs computed from a normalized signal
- test_name: str
(Optional) Test type. Supported values: ‘apriori’, ‘aposteriori’. (default ‘aposteriori’)
- rescaling_imf: int
(Optional) ith IMF of the signal used in rescaling for ‘a posteriori’ test. (default 1)
- alpha: float
(Optional) The percentiles at which the test is to be performed; 0 < alpha < 1; (default 0.95)
- Returns:
- Optional dictionary
Returns dictionary with keys and values as IMFs’ number and test result, respetively, Test results can be either 0 (fail) or 1 (pass). In case of problems with the input imfs, e.g. NaN values or no imfs, we return None.
References
[Wu2004]Zhaohua Wu, and Norden E. Huang. “A Study of the Characteristics of White Noise Using the Empirical Mode Decomposition Method.” Proceedings: Mathematical, Physical and Engineering Sciences, vol. 460, no. 2046, The Royal Society, 2004, pp. 1597–611, http://www.jstor.org/stable/4143111.
Examples
>>> import numpy as np >>> from PyEMD import EMD >>> from PyEMD.checks import whitenoise_check >>> T = np.linspace(0, 1, 100) >>> S = np.sin(2*2*np.pi*T) >>> emd = EMD() >>> imfs = emd(S) >>> significant_imfs = whitenoise_check(imfs, test_name='apriori') >>> significant_imfs {1: 1, 2: 1} >>> type(significant_imfs) <class 'dict'>