nemos.simulation.difference_of_gammas#

nemos.simulation.difference_of_gammas(ws, upper_percentile=0.99, inhib_a=1.0, excit_a=2.0, inhib_b=1.0, excit_b=2.0)[source]#

Generate coupling filter as a Gamma pdf difference.

Parameters:
  • ws (int) – The window size of the filter.

  • upper_percentile (float) – Upper bound of the gamma range as a percentile. The gamma function will be evaluated over the range [0, ppf(upper_percentile)].

  • inhib_a (float) – The a constant for the gamma pdf of the inhibitory part of the filter.

  • excit_a (float) – The a constant for the gamma pdf of the excitatory part of the filter.

  • inhib_b (float) – The b constant for the gamma pdf of the inhibitory part of the filter.

  • excit_b (float) – The a constant for the gamma pdf of the excitatory part of the filter.

Return type:

NDArray

Notes

The probability density function of a gamma distribution is parametrized as follows [1] :,

\[p(x;\; a, b) = \frac{b^a x^{a-1} e^{-x}}{\Gamma(a)},\]

where \(\Gamma(a)\) refers to the gamma function, see [1].

Returns:

The coupling filter.

Return type:

filter

Raises:
  • ValueError: – If any of the Gamma parameters is lesser or equal to 0.

  • ValueError: – If the upper_percentile is not in [0, 1).

Parameters:

References

Examples

>>> import matplotlib.pyplot as plt
>>> from nemos.simulation import difference_of_gammas
>>> coupling_duration = 100
>>> inhib_a, inhib_b = 1.0, 1.0
>>> excit_a, excit_b = 2.0, 2.0
>>> coupling_filter = difference_of_gammas(
...     ws=coupling_duration,
...     inhib_a=inhib_a,
...     inhib_b=inhib_b,
...     excit_a=excit_a,
...     excit_b=excit_b
... )
>>> _ = plt.plot(coupling_filter)
>>> _ = plt.title("Coupling filter from difference of gammas")
>>> _ = plt.show()

(Source code)

../../_images/nemos-simulation-difference_of_gammas-1.png

Fig. 55 Difference of Gammas.#