MexicanHatProfile#
- class braintools.init.MexicanHatProfile(sigma, amplitude=1.0, max_distance=None)#
Mexican Hat (Ricker wavelet) distance profile.
Connection probability follows a Mexican hat shape, which is the second derivative of a Gaussian function. This creates a center-surround pattern with positive values at the center, negative values in the surround, and approaching zero at far distances. The negative values are clipped to zero for probability interpretation.
- The (peak-normalized) Mexican hat function used here is:
f(d) = amplitude * (1 - (d/sigma)^2) * exp(-(d/sigma)^2 / 2)
This form peaks at
amplitudewhend = 0and is invariant to the unit in whichsigma/distancesare expressed (it depends only on the dimensionless ratiod/sigma). The classical wavelet L2-normalization constant2 / (sqrt(3*sigma) * pi^(1/4))is intentionally dropped because it is unit-dependent and would make the peak height vary with the chosen length unit.- Parameters:
sigma (
Array|ndarray|bool|number|bool|int|float|complex|Quantity) – Standard deviation controlling the width of the profile.amplitude (
float) – Amplitude scaling factor; equals the peak value atd = 0(default: 1.0).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 MexicanHatProfile >>> >>> profile = MexicanHatProfile( ... sigma=50.0 * u.um, ... amplitude=1.0, ... max_distance=300.0 * u.um ... ) >>> distances = np.array([0, 25, 50, 100, 200]) * u.um >>> probs = profile.probability(distances)