pyhctsa.operations.nonlinearity.local_density

pyhctsa.operations.nonlinearity.local_density(y, nnr=3, past=40, tau='ac', m=2)

Local density estimates in the time-delay embedding space.

Computes a standard k-nearest-neighbor local density estimate at each point of the time-delay embedding: density(i) is proportional to 1/r_NNR(i)^m, where r_NNR(i) is the distance from point i to its NNR-th nearest neighbor (excluding temporally-close points within a Theiler window of “past” samples) and m is the embedding dimension.

Parameters:
y : array-like

Input time series.

nnr : int, optional

Number of nearest neighbours to compute. Default is 3.

past : int, optional

Number of time-correlated points to discard (samples), i.e., the Theiler window. Default is 40.

tau : str or int, optional

The time-delay of the embedding, either an integer or 'ac' for the first zero-crossing of the autocorrelation function. Default is 'ac'.

m : int, optional

The embedding dimension. Default is 2.

Returns:

Various statistics on the local density estimates at each point in the time-delay embedding, including the minimum and maximum values, the range, the standard deviation, mean, median, and autocorrelation.

Return type:

dict