Detection of non-stationary processes

The Change point detection algorithm [cpd1] determines if a spike train spiketrain can be considered as a stationary process (constant firing rate) or not as stationary process (i.e. presence of one or more points at which the rate increases or decreases). In case of non-stationarity, the output is a list of detected Change Points (CPs).

Essentially, a set of two-sided windows of width h (_filter(t, h, spiketrain)) slides over the spike train within the time [h, t_final-h]. This generates a _filter_process(time_step, h, spiketrain) that assigns at each time t the difference between a spike lying in the right and left windows. If at any time t this difference is large ‘enough’, the presence of a rate Change Point in a neighborhood of t is assumed. A threshold test_quantile for the maximum of the filter_process (max difference of spike count between the left and right windows) is derived based on asymptotic considerations. The procedure is repeated for an arbitrary set of windows with different sizes h.

multiple_filter_test(window_sizes, …[, …]) Detects change points.
empirical_parameters(window_sizes, t_final, …) This function generates the threshold and the null parameters.

Examples

>>> import quantities as pq
>>> from elephant.change_point_detection import multiple_filter_test
>>> spike_times = [1.1, 1.2, 1.4, 1.6, 1.7, 1.75, 1.8, 1.9, 1.95] * pq.s
>>> change_points = multiple_filter_test(window_sizes=[0.5] * pq.s,
...     spiketrain=spike_times, t_final=2.1 * pq.s, alpha=5, n_surrogates=100,
...     time_step=0.1 * pq.s)
[[array(1.5) * s]]

Original code

Adapted from the published R implementation: DOI: 10.1214/14-AOAS782SUPP;.r

References

[cpd1]Michael Messer, Marietta Kirchner, Julia Schiemann, Jochen Roeper, Ralph Neininger, Gaby Schneider, and others. A multiple filter test for the detection of rate changes in renewal processes with varying variance. The Annals of Applied Statistics, 8(4):2027–2067, 2014.