pyhctsa.operations.nonlinearity.nsamdf¶
-
pyhctsa.operations.nonlinearity.nsamdf(x, tau_mult=
2, win_len_rel=10, shift_len_rel=0.5, degree=7)¶ Computes the nonlinearity measure L through nsAMDF (nonlinear average magnitude difference function), developed by Ozkurt et al. [1].
The lag range and window of the nsAMDF are set from the time series’ own correlation time: with
tauthe first zero-crossing of the autocorrelation function, the maximum lag isceil(tau_mult*tau)and the window lengthwin_len_reltimes that. The normalized curves of the nsAMDF forp = 2andp = degreeare compared by their root-mean-square difference.This function was authored by Tolga Esat Ozkurt, 2020. (tolgaozkurt@gmail.com). Edits by Ben Fulcher for incorporating into hctsa and Joshua Moore for incorporating into pyhctsa.
References
- Parameters:¶
- x : array-like¶
Input time series.
- tau_mult : float or int¶
The maximum lag, as a multiple of the first zero-crossing of the autocorrelation function. Default is 2.
- win_len_rel : float or int¶
The window length, as a multiple of the maximum lag (a long enough segment is important to estimate the nonlinearity). Default is 10.
- shift_len_rel : float or int¶
The shift between successive windows, as a proportion of the window length (window length minus overlap). Default is 0.5.
- degree : int¶
The chosen degree p should ideally be large enough to capture the highest order of nonlinearity within the data. Default is 7.
- Returns:¶
L, the nsAMDF nonlinearity measure: the root-mean-square difference between the nsAMDF curves for p = 2 and p =degree, each normalized by its maximum (so it is invariant to the scale of the series). Returns NaN if the autocorrelation function has no zero-crossing, or the window is longer than the time series.- Return type:¶
dict