Neural Coding · Lesson 3 of 3 · ~6 min

Rates need windows

Predict

Eight trials, true rate $20$ Hz. Estimate the rate as spike count over window length. Shrink the window from $1000$ to $50$ ms. The estimate gets…

Drag counting window down and watch the spread stat.
Try
Try itDrag counting window from $1000$ ms to $200$, then $50$ ms. Watch the per-trial counts, mean rate and spread.
Notice

At $1000$ ms the counts are the estimates: $14$ to $28$ Hz, spread $4.7$ Hz. The spread grows to $12.5$ Hz at $200$ ms and $17.1$ at $50$, where estimates can only be $0, 20, 40, 60$ Hz.

Explain

A rate isn't on the raster. You compute it:

$$\hat{r} = \frac{n}{T}$$

$n$ counts spikes in a window of length $T$. Counts vary even at a fixed rate; small $T$ amplifies that. One extra spike moves a $1000$ ms estimate by $1$ Hz, a $50$ ms estimate by $20$ Hz.

Long windows average the noise down but smear over any change in the true rate. Short windows can track change, but whole-spike steps bury the signal. The smooth rates of lessons 1 and 2 assumed long windows.

About this model

What it represents: eight independent trials of a Poisson-like spike process at a constant $20$ Hz — intervals drawn as exponential waits from a seeded generator, so every reader sees the identical raster and can check the identical statistics.

What it leaves out: the variability model is itself a modeling choice, not a fact about neurons. Real spike trains show refractoriness (no two spikes arbitrarily close), bursting, slow drifts in excitability, and spike-count variance that can sit above or below the Poisson benchmark — treating spiking as Poisson is a decision this lesson makes openly, because it is the standard baseline against which those behaviors are measured.

Source: Gerstner, Kistler, Naud and Paninski, Neuronal Dynamics, Ch. 7.3 (EPFL, free online) — spike-train variability and the Poisson model's place in it.

Apply
Checkpoint — prove it to yourself

At the $50$ ms window, the per-trial estimates only ever take the values $0$, $20$, $40$ or $60$ Hz. Why?

The full-second window averages $21.5$ Hz, not $20.0$. What is the right conclusion?

Transfer: a stimulus makes the true rate switch every $100$ ms, and you must follow it. Which window do you take?

Key idea

A firing rate is always measured over some window $T$. Long $T$ buys steadiness; short $T$ buys speed.

← All lessons