gamma

Contents

gamma#

class brainpy.state.spatial.gamma(x=spatial.distance, kappa=1.0, theta=1.0)[source]#

Gamma distance-dependent connection probability.

Returns a callable p(d) = d^{kappa-1} exp(-d/theta) / (theta^kappa Gamma(kappa)) matching NEST’s nest.spatial_distributions.gamma(distance, kappa, theta).

Parameters:
  • x (object, optional) – The distance sentinel (or a per-axis expression such as distance.x).

  • kappa (float, optional) – Shape parameter. Default 1.

  • theta (float or Quantity, optional) – Scale parameter (length); bare floats are taken in micrometres. Default 1.

Returns:

p(d) mapping a distance (Quantity) to a connection probability.

Return type:

callable

Examples

>>> from brainpy import state as bp
>>> import brainunit as u
>>> p = bp.spatial.gamma(bp.spatial.distance, kappa=2.0, theta=1.5)
>>> float(u.get_magnitude(p(1.5 * u.um))) > 0.0
True