PowerLawProfile#
- class braintools.init.PowerLawProfile(exponent, min_distance=None, max_distance=None)#
Power-law distance profile.
Connection probability follows a scale-invariant power-law decay:
p(d) = (max(d, d0) / d0) ** (-exponent), whered0is the reference lengthmin_distance. Expressed as a dimensionless ratio, the profile is invariant to the unit in which distances are measured (100 um and 0.1 mm give the same probability), peaks at 1 ford <= d0, and is finite atd = 0.- Parameters:
exponent (
float) – Power-law exponent (positive values cause decay with distance).min_distance (
Array|ndarray|bool|number|bool|int|float|complex|Quantity|None) – Reference lengthd0below which the probability saturates at 1.0, also avoiding division by zero (default:1.0 * u.um, or1.0for unitless distances).max_distance (
Array|ndarray|bool|number|bool|int|float|complex|Quantity|None) – Maximum connection distance (connections beyond this are set to 0).
Examples
>>> import numpy as np >>> import brainunit as u >>> from braintools.init import PowerLawProfile >>> >>> profile = PowerLawProfile( ... exponent=2.0, ... min_distance=1.0 * u.um, ... max_distance=1000.0 * u.um ... ) >>> distances = np.array([1, 10, 100, 1000]) * u.um >>> probs = profile.probability(distances)