neurotic._elephant_tools

The neurotic._elephant_tools module contains functions and classes copied from the elephant package, which are included for convenience and to eliminate dependency on that package. Original code that builds on this work (e.g., a new kernel) is also contained in this module.

Warning

This module and the functions and classes it contains are not intended to be part of neurotic’s public API, so the module name begins with an underscore. This module may be moved, renamed, or removed at a future date and replaced with explicit dependence on the elephant package.

class neurotic._elephant_tools.CausalAlphaKernel(sigma, invert=False)[source]

This modified version of elephant.kernels.AlphaKernel shifts time such that convolution of the kernel with spike trains (as in elephant.statistics.instantaneous_rate()) results in alpha functions that begin rising at the spike time, not before. The entire area of the kernel comes after the spike, rather than half before and half after, as with AlphaKernel. Consequently, CausalAlphaKernel can be used in causal filters.

The equation used for CausalAlphaKernel is

\[\begin{split}K(t) = \left\{\begin{array}{ll} (1 / \tau^2) \ t\ \exp{(-t / \tau)}, & t > 0 \\ 0, & t \leq 0 \end{array} \right.\end{split}\]

with \(\tau = \sigma / \sqrt{2}\), where \(\sigma\) is the parameter passed to the class initializer.

In neuroscience a popular application of kernels is in performing smoothing operations via convolution. In this case, the kernel has the properties of a probability density, i.e., it is positive and normalized to one. Popular choices are the rectangular or Gaussian kernels.

Exponential and alpha kernels may also be used to represent the postynaptic current / potentials in a linear (current-based) model.

sigma : Quantity scalar
Standard deviation of the kernel.
invert: bool, optional
If true, asymmetric kernels (e.g., exponential or alpha kernels) are inverted along the time axis. Default: False