elephant.statistics.lv¶
-
elephant.statistics.
lv
(v, with_nan=False)[source]¶ Calculate the measure of local variation LV for a sequence of time intervals between events.
Given a vector v containing a sequence of intervals, the LV is defined as:
The LV is typically computed as a substitute for the classical coefficient of variation for sequences of events which include some (relatively slow) rate fluctuation. As with the CV, LV=1 for a sequence of intervals generated by a Poisson process.
Parameters: - vpq.Quantity or np.ndarray or list
Vector of consecutive time intervals.
- with_nanbool, optional
If True, lv of a spike train with less than two spikes results in a np.NaN value and a warning is raised. If False, a ValueError exception is raised with a spike train with less than two spikes. Default: True.
Returns: - float
The LV of the inter-spike interval of the input sequence.
Raises: - ValueError
If an empty list is specified, or if the sequence has less than two entries and with_nan is False.
If a matrix is passed to the function. Only vector inputs are supported.
Warns: - UserWarning
If with_nan is True and the lv is calculated for a spike train with less than two spikes, generating a np.NaN.
References
[1] S. Shinomoto, K. Shima, & J. Tanji, “Differences in spiking patterns among cortical neurons,” Neural Computation, vol. 15, pp. 2823–2842, 2003.