braintools.cogtask.rate_to_prob#
- braintools.cogtask.rate_to_prob(base, dt)[source]#
Convert a firing rate to a spike probability per time step.
Computes
base * dt / 1000: the probability that a Poisson neuron firing atbaseHz emits a spike within one step ofdtms. This function was calledfiring_ratebefore braintools 0.4.0; that name remains as a deprecated alias.- Parameters:
- Returns:
Spike probability per time step,
base * dt / 1e3.- Return type:
- Raises:
ValueError – If
base * dt > 1e3, i.e. the probability would exceed 1.
Examples
>>> from braintools.cogtask import rate_to_prob >>> rate_to_prob(100.0, 1.0) 0.1