The Point-Process GLM

A neuron’s spike train is a coin flipped every few milliseconds. A stimulus filter and a spike-history filter set how the coin is weighted.

Learn how to write a spike train as a Poisson generalized linear model, score it with a log likelihood, fit it to data and simulate new spikes from it.

Pick a history filter and drag the stimulus gain. Watch six trials of one neuron under the same stimulus. Then we build, piece by piece, the count model, the likelihood, the nonlinearity, the design matrix, the fit and the filters.

You need a rough idea of a probability (a number from 0 to 1) and a little matrix algebra. We build the rest from zero.

Follows Princeton NEU 560, Statistical Modeling and Analysis of Neural Data (Spring 2024, Jonathan Pillow), Lectures 9 and 10: slides 9 and slides 10. Every idea is re-taught here in our own words and devices, with the primary papers listed in the Field Guide.

Flip the coin, bin by bin

1.00

Illustrative model: 5 ms bins over 1.5 s, a 25 Hz base rate, rate = 25 × exp(gain × stimulus + history), and one spike or none per bin. The filters are made-up shapes, not fitted to a cell.

Chapter 0

Why a Spike Train Needs a Model

See why a list of spike times becomes a table of small counts, and why that table needs a probability model

An electrode sits next to one neuron in motor cortex. The neuron fires a brief electrical pulse, a spike, about twenty times a second. Your computer stores one number for each spike: the time it happened. After one second you hold a list of about twenty times. That list is a spike train.

Now you want to ask a question. How does this neuron respond to what the animal sees or does? You also want the opposite. Given only the spikes, what did the animal do? A brain-computer interface needs both directions, and both need the same thing: a model that says how likely a spike train is.

Run the same reach twice and the spike train changes. Say the neuron fires 19 spikes the first time and 23 the second (illustrative numbers). The pattern of times differs. Any model must therefore speak in probabilities, not in fixed answers. This lesson builds the standard one, step by step.

Cut time into bins

A list of times is awkward to feed into a regression. So we cut time into equal slices, called bins, and write down how many spikes fell in each. Think of a rain gauge: one cup per minute, and you count the drops in each cup. A spike train becomes a row of small whole numbers, mostly zeros.

The bin size is a choice. A 1 ms bin is so short that two spikes almost never share it. A 100 ms bin often holds several. The slide deck in NEU 560 writes the result as a string such as 0 0 1 1 0 1 1 0, one symbol per bin. We use the same picture.

Cut the spike train into bins

The dots are spike times in one second. The bars show the count in each bin. Drag the bin size and watch the counts change from mostly 0 and 1 to larger numbers.

5 ms

Illustrative: one second of spikes made by a seeded random process with a slowly changing rate near 20 Hz. It is not a recording.

At 5 ms, almost every bin holds 0 or 1 spike. This is the regime the rest of the lesson uses. A model for it needs only to say: how likely is a spike in this bin, given what we know?

Two directions: encoding and decoding

The lecture frames today’s topic as regression models: a rule that gives the probability of a response y from some inputs x and parameters θ, written P(y | x, θ). In an encoding model the response y is the neural activity (spikes, but also EEG power or a calcium signal) and the input x is the world: a stimulus, a movement, a task variable. In a decoding model the roles swap. The neural activity goes in, and the world comes out.

Both directions use the same probability rule. Once you know how the world makes spikes, Bayes’ rule flips it around to guess the world from spikes. That is why an encoding model is worth building even when your goal is a decoder. Chapter 9 returns to this point with a real result from the literature.

The road

The lecture has two halves, and so does this lesson. First, a single number per trial: the spike count. We meet the Poisson law, the likelihood and the generalized linear model. Second, a whole spike train: the design matrix, the log likelihood in each bin, fitting, and the filters that give the neuron a memory.

  1. Counting spikes: coin flips turn into the Poisson law.
  2. Likelihood: score a model by how well it explains the data.
  3. Least squares: the Gaussian model you already know.
  4. The GLM: a filter, a bend, then noise.
  5. The design matrix: a spike train becomes a regression table.
  6. The log likelihood of a train: one term per bin.
  7. Fitting: climb a bowl-shaped score.
  8. Spike history: refractory, bursting, adapting.
  9. Coupling and simulation: many neurons, and new spikes from the fit.
  10. Field Guide: numbers, code and where to go next.

What you will be able to do

By the end you will write a spike model in one line, score it with a log likelihood, fit it with a short loop and simulate new spike trains from it. Each step uses only the step before it. Nothing here needs more than a sum, a logarithm and a derivative. If any of these feels rusty, the chapters rebuild them in place.

One habit runs through the whole lesson. Every model gets two checks: does the equation make a legal probability, and do spikes drawn from it look like the real ones? A model that fails the first check is wrong on paper. A model that fails the second is wrong on the data.

Why must a model of a spike train give probabilities rather than one fixed answer?

Chapter 1

Counting Spikes: The Poisson Law

Turn a thousand tiny coin flips into one law that says how many spikes land in a window

Picture a 100 ms window of time. Cut it into a thousand slices of 0.1 ms. In each slice the neuron either fires or it does not, and firing is rare. Each slice is like a coin that lands heads with a very small probability. The spike count in the window is the number of heads.

You never need to track the thousand slices. A single law describes the total. This law is what the lecture calls the Poisson distribution, and it comes from one limit.

From coins to the Poisson law

Flip n coins. Each lands heads with probability p. The number of heads follows the binomial distribution. Its average is n times p. Call that average λ (lambda), the expected number of heads.

Now make the coins more numerous and more weak. Let n grow while p shrinks, so that λ = n·p stays fixed. The lecture’s own sequence is 10 coins with p = 0.1, then 100 with p = 0.01, then 1000 with p = 0.001. Each has λ = 1. In the limit the binomial turns into the Poisson distribution:

P(y = k)
The probability that the count y is exactly the whole number k, for k = 0, 1, 2 and so on.
λk
The rate λ multiplied by itself k times. A larger rate favours larger counts.
e−λ
A shrink factor that makes all the probabilities add up to 1. For k = 0 it is the whole answer: the chance of no spike.
k!
“k factorial”: 1 × 2 × … × k. It counts the orderings of the spikes inside the window, which the formula divides out.

Check the zero-spike case at λ = 1. The formula gives e−1 = 0.3679. With 10 coins at p = 0.1 the exact chance of no heads is 0.910 = 0.3487. With 100 coins it is 0.99100 = 0.3660. With 1000 coins it is 0.3677. The binomial walks toward the Poisson value. Drag the coin count below and watch the bars match.

From coin flips to Poisson

Blue bars: the exact chance of each number of heads from n coins. Warm outline: the Poisson law with the same average. Drag n up and the two agree.

10
1

Exact arithmetic, computed live: binomial chance = C(n,k) pk(1−p)n−k with p = λ/n. The gap number is the largest difference between any pair of bars. The coin counts 10, 100 and 1000 with λ = 1 are the lecture’s own sequence.

The one property you must remember

For a Poisson count, the average equals λ and the variance (the typical squared spread around the average) also equals λ. Mean and variance are the same number. The lecture writes it as “= mean = variance” beside its Poisson plot.

Spike counts really behave this way, roughly. A cell that averages 4 spikes per window has a spread of about 2 spikes (the square root of 4). A cell that averages 100 has a spread of about 10. The noise grows with the rate, but more slowly than the rate. The ratio variance over mean is called the Fano factor. A pure Poisson count has a Fano factor of exactly 1.

The linear Poisson neuron

The lecture’s first encoding model uses this law. A stimulus x, say the contrast of an image, sets the rate: λ = θ·x. The parameter θ is how many spikes the neuron adds per unit of contrast. The count is then drawn from a Poisson law with that rate: y | x ~ Poisson(θ·x).

A worked case. Say θ = 0.8 spikes per unit contrast. At contrast 5 the rate is 4, so counts near 4 are likely: P(y = 4) = 44e−4/4! = 256 × 0.01832 / 24 = 0.195. At contrast 25 the rate is 20. The typical count is 20, and the spread is about 4.5. The lecture plots this as a cloud of counts whose width grows with the contrast. Each vertical slice is one Poisson bar chart.

Notice what we gained. The model has one number, θ, yet it describes every slice. The job of fitting is to find the θ that makes the observed counts least surprising. Chapter 2 makes that precise.

Does a real cell obey the law? Measure the Fano factor

Real cells can break the rule. The test is simple. Record the same stimulus many times, count the spikes in each window, and compute the variance of the counts divided by their mean. That ratio is the Fano factor. For the five counts 3, 5, 4, 6, 2 the mean is 4 and the variance is 2, so the ratio is 0.5. Five windows are too few to conclude anything, since the ratio of a true Poisson count scatters widely around 1 in so small a sample.

The symptom of a broken Poisson assumption is a Fano factor well away from 1 in a large sample. Above 1 means the counts are burstier than Poisson. Below 1 means they are more regular, as when a cell has a refractory period. The fix is not to give up on the model but to add what the Poisson law leaves out: the cell’s own recent spikes. Chapter 8 does exactly that.

A neuron fires on average 9 spikes per window and its counts are Poisson. About how large is the typical spread of its counts?

Chapter 2

Likelihood: Score a Model by the Data It Explains

Slide a rate guess along a line and watch one number rise to a peak, then solve for the peak with pencil and paper

You counted spikes in five windows of equal length: 3, 5, 4, 6 and 2. Your friend says the neuron’s rate is 3 spikes per window. Another says 5. A third says 4. Who is right? Nobody can be sure, but one guess surprises you least when you look at the data. We need a number that measures that surprise.

Probability reads forward, likelihood reads backward

The Poisson law gives the chance of a count y when the rate is λ. Read it forward: fix λ, ask about y. Now read the same formula backward. Fix the counts you saw, and ask how the chance changes as you move λ. The formula is the same. Only the question changed. The lecture calls the backward reading the likelihood: the probability of the data seen, viewed as a function of the parameters.

The lecture puts this as a quick quiz on P(y | x, θ). As a function of the spikes y, it is the encoding distribution. As a function of the parameters θ, it is the likelihood function. As a function of the stimulus x, it is the stimulus likelihood, and decoders use it to guess the stimulus. One formula, three questions.

Many windows: multiply, then take logs

With many windows we need one score for all of them. We assume the windows are conditionally independent: given the rate, one window’s count tells you nothing more about another’s. The lecture asks what assumption maximum likelihood makes about the responses, and this is the answer. Independence lets us multiply the single-window chances.

A product of many small numbers is awkward. It gets tiny fast, and a computer can round it to zero. So we take the logarithm, which turns the product into a sum. The log likelihood for Poisson counts y1 to yN is:

L(λ)
The log likelihood: one score for a rate guess λ. Higher is better.
∑i
Add up over every window, i = 1 to N.
yi log λ
Rewards a rate that is high when the count was high.
−λ
Punishes a rate that is high when a count was low. Together with the term on its left, it makes the score peak at the right rate.
log yi!
Depends only on the data, not on λ. It shifts the whole curve up or down and never moves the peak.

Find the peak with algebra

The lecture gives the recipe in three steps. Compute the log likelihood. Take its derivative with respect to the parameter. Set the derivative to zero and solve. For our model the derivative is the sum of yi/λ minus N. Setting it to zero gives Nλ = ∑yi, so:

λ̂ = (y1 + … + yN) / N = (3 + 5 + 4 + 6 + 2) / 5 = 4

The best rate is the average count. Our third friend was right. Now check the scores. The constant sum of log y! is 17.03 for these five counts. At λ = 4 the log likelihood is 20·ln 4 − 5·4 − 17.03 = −9.30. At λ = 3 it is −10.06. At λ = 5 it is −9.84. The peak is at 4, and the guess of 5 is closer to the peak than the guess of 3.

Climb the likelihood curve

The curve shows how far each rate guess falls below the best guess. Drag your guess and read the score. Then switch to more windows and watch the peak get narrower.

3.0

The 5-window set is the one in the text. The 20- and 100-window sets are drawn from a Poisson with true rate 4 by a seeded generator, so they are illustrative. Scores are computed live from the exact formula.

With 5 windows the curve is wide: guesses from about 3 to 5 all look fair. With 100 windows the curve is a narrow spike. More data pins the rate down. That is the reason maximum likelihood is called consistent: as the data grow without limit, the estimate converges to the true value. The lecture adds that it is also efficient: no other fair method converges faster, in the limit.

A rate that depends on the stimulus

Now bring back the linear Poisson neuron of Chapter 1, where λi = θ·xi. The same three steps apply. The derivative is ∑yi/θ minus ∑xi, so θ̂ = ∑y / ∑x. Take contrasts 1, 2, 3, 4, 5 and counts 1, 3, 3, 5, 8. Then θ̂ = 20/15 = 1.33 spikes per unit contrast. The neuron adds about one and a third spikes for each unit of contrast.

Why logs matter in practice

The product form has a practical trap. Suppose each window contributes a chance of about 0.18. Over 100 windows the product is about 10−74, which a computer can still hold. Over 500 windows it is about 10−372, below the smallest number a 64-bit float can store (near 10−308). The product silently becomes 0, and every rate then scores the same. The sum of natural logs for the same 500 windows is about −857, an ordinary number.

So every real fitting routine works with the log likelihood, never with the raw product. The peak is in the same place, because the logarithm only ever rises as its input rises. This is also why the constant term log y! can be dropped: adding a constant to a curve moves it up or down and leaves the peak where it was.

Counts of 2, 6 and 4 are Poisson. Which rate has the highest likelihood?

Chapter 3

Least Squares Is a Gaussian Likelihood

Show that the regression you already know is maximum likelihood with a bell-curve noise model, then see where it fits spikes badly

You have used least squares before: draw the line that sits closest to the points, measured by squared distance. It looks like pure geometry. It hides a probability model, and seeing that model is the key that opens the GLM.

The linear-Gaussian neuron

Say a neuron’s spike count follows the stimulus along a straight line, with noise on top: y = θ·x + ε. The noise ε is Gaussian, the bell curve. It has average 0 and a spread σ (sigma) that is the same for every stimulus. The lecture draws this as a cloud of counts where “all slices have the same width.”

Write the chance of one count under this model: it is a bell curve centred on θ·x. The log of a bell curve is minus the squared distance from the centre, divided by 2σ², plus a constant. For all the data:

L(θ)
The log likelihood of the slope θ. We want the θ that makes it largest.
1 / (2σ²)
A positive weight. It scales the score but does not move the peak.
∑ (y − θx)²
The sum of squared errors: how far each count sits from the line, squared, then added.
const
Terms that do not contain θ. They never matter for the peak.

Look at the minus sign. A larger sum of squared errors gives a lower likelihood. So the θ that minimises the squared error is the θ that maximises the likelihood. The lecture states it as a general point: minimising a sum of squares is always the same as maximising likelihood under a Gaussian noise model.

Solve it by hand

Differentiate with respect to θ and set the result to zero. For one stimulus number per bin this gives θ̂ = ∑xiyi / ∑xi². A tiny case: contrasts 1, 2, 3 and counts 2, 3, 7. The top is 1·2 + 2·3 + 3·7 = 29. The bottom is 1 + 4 + 9 = 14. So θ̂ = 29/14 = 2.07.

With a vector of stimulus numbers, the same steps give the normal equations. Stack the stimuli as the rows of a matrix X and the counts as a column Y. Then k̂ = (XTX)−1 XT Y. In code this is one line: k_hat = np.linalg.solve(X.T @ X, X.T @ Y). The lecture notes that when the stimulus is white noise, XTY is the spike-triggered average (STA): for each lag, the average stimulus value just before a spike.

Where the Gaussian fits spikes badly

Spike counts are small whole numbers that cannot be negative. The Gaussian model allows negative counts. It also says a miss of 7 spikes is as likely at low contrast as at high contrast. But a Poisson count near 4 has a spread of 2, and a count near 40 has a spread of 6.3. The slices are not the same width.

You can feel the difference. In the device below, the same 30 data points are fitted two ways. The Gaussian fit uses one band width everywhere. The Poisson fit uses a band that widens as the line rises. Switch between them.

Same points, two noise models

Blue dots are spike counts at different contrasts. The warm line is the fitted rate. The shaded band is one spread above and below. Choose a noise model, then draw new data.

Illustrative: 30 counts from a Poisson neuron with a true slope of 1.3 spikes per unit contrast, contrasts from 2 to 40, seeded. The Gaussian slope is sum(xy) / sum(x²). The Poisson slope is sum(y) / sum(x), from Chapter 2.

Both fits find nearly the same line, since both are sensible. They differ in what they believe about the noise. At contrast 5 the Gaussian band is far too wide: it allows counts below zero. At contrast 40 it is too narrow. The Poisson band tracks the data. When you want probabilities of spike counts, the noise model matters.

Measure the damage: residual spread against rate

How would you notice that Gaussian noise is wrong? Fit the line, compute each residual (count minus line), and plot the size of the residuals against the fitted rate. A Gaussian model predicts a flat cloud. For spikes, the cloud fans out. With the slope of 1.3 spikes per unit contrast, a Poisson spread is the square root of the rate: about ±2.5 spikes at contrast 5 (rate 6.5) and about ±7.2 at contrast 40 (rate 52). A single Gaussian spread must choose one number for both, so it is wrong at one end or the other.

The cost is not only a wrong band. A Gaussian fit gives the same weight to a count at contrast 40, where scatter is large, as to a count at contrast 5, where scatter is small. The noisy points pull the line harder than they deserve. The Poisson likelihood weighs each point by how precise it is. That is the practical gain of matching the noise law to the data.

Why does minimising the sum of squared errors also maximise the Gaussian log likelihood?

Chapter 4

The GLM: A Filter, a Bend, Then Noise

Split any spike model into three plain stages, and learn why a bend in the middle keeps the rate from going negative

The lecture shows a cloud of spike counts for an unknown neuron. The counts rise with contrast, but the rise curves upward. A straight line fails. A straight line with Gaussian noise fails too. What model would you build? The answer is a pattern with three stages. It covers least squares, logistic regression and Poisson regression in one frame.

Three stages

The stage names come from the lecture’s diagram. Stage one is linear: combine the stimulus values into one number, u = θ·x. This is a weighted sum, the same step as in any linear regression. The lecture calls it “dimensionality reduction”, because many stimulus numbers become one.

Stage two is a nonlinearity, a fixed bend f applied to u. The lecture calls it “warping”. Its job is to turn the free-ranging number u into a legal value for the noise stage, for instance a rate that is never negative. Stage three is noise: a probability law, from a family called the exponential family (it holds the Gaussian, the Poisson and the Bernoulli coin), that draws the actual response around the value the bend produced.

stimulus x → u = θ·x → rate = f(u) → response y drawn around the rate

A generalized linear model (GLM) is exactly this chain. The lecture warns about a name clash. A general linear model has only the first and third stages: linear, then noise. A generalized linear model adds the bend in the middle. The two share the letters GLM. This lesson always means the generalized one.

The bend must fit the noise

Each noise law accepts only some values, so each puts a rule on the bend. The lecture asks what rule, and answers: none for a Gaussian, non-negative for a Poisson, and between 0 and 1 for a Bernoulli coin. A Poisson rate below zero means nothing. A coin probability above 1 means nothing.

The lecture also names a favourite bend for each law, its canonical choice. The Gaussian uses the identity: f(u) = u, which is plain least squares. The Bernoulli coin uses the logistic function, 1/(1 + e−u), and that gives logistic regression. The Poisson uses the exponential, eu. A common alternative for Poisson is the softplus, log(1 + eu). Both are non-negative and rise smoothly. A full GLM lesson on this site shows the general theory.

Take one number through all of them. Let the filter output be u = −1. The identity gives a rate of −1 spike, which is impossible. The exponential gives e−1 = 0.368. The softplus gives log(1 + 0.368) = 0.313. The logistic gives 1/(1 + 2.718) = 0.269 and counts as a probability. Try your own values.

Bend the filter output

The curve shows the rate that each bend assigns to a filter output u. Pick a bend, then drag u. The red zone marks rates that no real neuron can have.

-1.00

Exact functions: identity u, exponential eu, softplus log(1 + eu), logistic 1/(1 + e−u). The logistic is a probability for a Bernoulli coin, so it is bounded by 1.

Why the exponential is a good default

The exponential has a handy property: ea+b = ea·eb. Two inputs added inside the bend multiply outside it. If the stimulus raises the filter output by 0.7, the rate multiplies by e0.7 = 2. If a past spike lowers it by 0.7, the rate halves. Chapter 8 uses this: the stimulus and the neuron’s own history act as gain factors on one another.

The exponential has a second, deeper advantage. With it, the log likelihood is a bowl with one bottom, so fitting cannot get stuck. Chapter 7 shows why. The lecture adds a caution. The literature fixes f in advance, but you can test several choices or fit the shape of f itself. The closed-form solution of Chapter 3 exists only when f is the identity.

Choosing the bend from the data

The lecture asks you to be the computational neuroscientist: given counts that curve upward with contrast, what model do you pick? A practical recipe is to fit two or three candidates and compare their log likelihood on spikes that were held out. The model with the higher held-out score has the better bend. The exponential often wins because real firing rises faster than linear at low drive and the exponential captures that growth.

The exponential has one risk. For large filter outputs it grows without limit. A drive of u = 5 gives a rate of 148 times the baseline, more than any real cell can fire. The softplus fixes this. It looks like the exponential for negative u, but it grows only linearly for large u. If a fitted model predicts absurd peak rates, try the softplus. The gradient formulas of Chapter 7 then gain an extra factor, so most people let a library handle that case.

One more way to read the weights. With the exponential bend, a filter weight of 0.7 on some stimulus feature multiplies the rate by e0.7 = 2 when that feature is one unit larger. A weight of −0.7 halves the rate. So the weights are log gains. This makes them easy to compare across cells.

You model spike counts with the identity as the bend and the Poisson as the noise. What can go wrong?

Chapter 5

From Counts to Trains: The Design Matrix

Turn a stimulus movie and a row of spikes into one regression table, with one row for each bin of time

So far each window gave one count and one stimulus number. A spike train is different. Time runs on, the stimulus changes every few milliseconds, and the neuron does not react to the stimulus at this instant. It reacts to the stimulus of the last few tens of milliseconds. A flash 20 ms ago still matters now.

The lecture opens the second half with a spike train written as bits, 001101100000100001000, and the instruction: walk through the data one time bin at a time. We do the same.

One bin, one small regression

Pick a bin, call its index t. The response yt is the spike count in that bin: mostly 0, sometimes 1. The input is the recent stimulus. Collect the last L stimulus values into a short vector xt = (st, st−1, …, st−L+1). Here s is the stimulus at one moment and L is how far back we look.

The lecture’s first model is the linear-Gaussian one from Chapter 3: yt = k·xt + noise. The vector k has L weights, one for each lag. It is a filter: it says how strongly the neuron weighs the stimulus now, 5 ms ago, 10 ms ago and so on. The stimulus window slides one bin at a time, so the same filter is used in every bin.

Stack the windows into a matrix

Write every bin’s window as one row. The result is the design matrix X. It has one row per time bin and one column per lag. Every row is the row above it, shifted by one place. A matrix with that pattern has a name: a Hankel matrix, and its mirror is a Toeplitz matrix. The lecture shows this on a slide with a note: “every row is a shifted copy of the row above.” The whole model is then one line: Y = Xk + noise.

A worked case with seven bins. The stimulus is s = (0, 1, 0, 0, 2, 1, 0). Use a filter of three lags, k = (2, 1, 0.5). Before the stimulus starts, we pad with zeros. Row 6 holds s6 = 1, s5 = 2 and s4 = 0. So row 6 is (1, 2, 0), and its product with the filter is 1·2 + 2·1 + 0·0.5 = 4. Row 7 is (0, 1, 2), which gives 0 + 1 + 1 = 2. Slide the window below and watch each row appear.

Slide the window, build the table

Top: the stimulus. The bracket marks the bins that row t reads. Middle: the matrix, one row per bin. Right: the filter times the row. Drag t, or change the filter length.

6

Toy numbers, not data: stimulus (0, 1, 0, 0, 2, 1, 0), filter (2, 1, 0.5, 0.25) cut to the chosen length, zeros before the start. The 7-bin size is only for display.

The shapes in a real fit

In a real experiment, T is the number of bins, for instance 60,000 bins for 5 minutes at 5 ms. A stimulus of a single number per bin and L = 20 lags gives X with shape T × L = 60000 × 20, a filter k: 20 and a response Y: 60000. For a movie of 10 × 10 pixels the window has 100 pixel values for each of 20 lags, so X has 60000 × 2000 columns. The filter then has 2,000 weights, one for each pixel and lag: a small movie of what the cell likes.

The product Xk is the same as sliding the filter along the stimulus and summing, a correlation or convolution. The design matrix is only a way to write that sliding sum as a matrix product, so a linear-algebra routine can solve for k. In the linear-Gaussian case the solve is k̂ = (XTX)−1XTY. When the stimulus is white noise, XTX is close to a multiple of the identity and k̂ is proportional to the spike-triggered average. In code:

import numpy as np
from scipy.linalg import hankel

s = np.array([0, 1, 0, 0, 2, 1, 0.])          # stimulus, shape (T,)
L = 3
pad = np.r_[np.zeros(L - 1), s]               # zeros before the start
X = np.stack([pad[i:i + L][::-1] for i in range(len(s))])   # (T, L): s_t, s_t-1, ...
k = np.array([2, 1, .5])
print(X @ k)                                   # [0. 2. 1. .5 4. 4. 2.]

The output is the vector of model values for the seven bins: 0, 2, 1, 0.5, 4, 4, 2. Check it against the rows above. The table works. Chapter 6 asks the next question: given this linear predictor, what is the probability of the spikes?

How long should the filter be, and what does it cost?

The window length L is a choice. If it is shorter than the neuron’s memory, the model misses real influence. If it is far longer, the extra columns add noise. A common start is to take the lag at which the spike-triggered average falls to zero and add a margin. The bin size and the window together set the cost: 5 minutes at 5 ms is 60,000 bins.

Memory is the practical limit. The 60,000 by 2,000 matrix of the movie example holds 120 million numbers. In 64-bit floats that is 960 MB. In 32-bit floats it is 480 MB. Two tricks help. First, never store the repeats: every row is a shifted copy, so a library can build the rows on demand. Second, replace the 20 lag columns with a few smooth basis shapes, so the filter has 5 weights, not 20. Both leave the fit unchanged in principle.

A 2 s recording is cut into 4 ms bins. The stimulus is a single number per bin and the filter has 25 lags. What is the shape of the design matrix?

Chapter 6

The Log Likelihood of a Spike Train

Write the score of a whole spike train as one sum, with a reward for each spike and a charge for each moment of high rate

The linear-Gaussian model of Chapter 5 has a flaw we met in Chapter 3. Spikes are not bell-shaped. In a 5 ms bin the answer is almost always 0, sometimes 1. A bell curve around a fitted value is the wrong shape. We now give each bin the right noise law, and write down the score of the whole train.

Option one: a coin per bin

If bins are so short that two spikes never share one, each bin is a coin. The lecture’s Bernoulli GLM sets the heads probability from the filter output: pt = f(xt·k). The bend f must keep p between 0 and 1. The standard choice is the logistic function. So logistic regression is a special case of a Bernoulli GLM, as the lecture notes.

The chance of one bin is pt when a spike came (yt = 1) and 1 − pt when none came (yt = 0). Take the log and add over bins:

L
The log likelihood of the whole spike train given the filter k.
∑t
Add over all T bins. Bins are conditionally independent given the filter outputs.
y log p
Counts only in bins with a spike. It rewards a high p there.
(1 − y) log(1 − p)
Counts only in empty bins. It punishes a high p where nothing happened.

Option two: a Poisson count per bin

When bins are long enough to hold several spikes, use a count. The Poisson GLM sets a firing rate λt = f(xt·k) in spikes per second. The lecture also calls it the conditional intensity: the rate of spiking at time t, given everything we condition on. Over a bin of width dt the expected count is μt = λt·dt, and the count is Poisson with that mean.

Apply the Poisson log chance from Chapter 2 to each bin and add. The terms log y! and y·log dt do not contain k, so they never move the peak. What is left is the lecture’s one-line result:

L = ∑t yt log λt − dt · ∑t λt

Read the two terms as a pair. The first rewards a high rate at each moment a spike happened. The second charges a price for every moment of high rate, spike or not. A model cannot win by predicting a high rate everywhere, because the charge grows with the rate. It must put its rate where the spikes are. The lecture’s code is two lines:

z = f(X @ k)                              # conditional intensity, shape (T,)
L = np.dot(y, np.log(z)) - dt * np.sum(z) # Poisson log likelihood, up to a constant

A worked check. Five bins have counts y = (0, 0, 1, 0, 1) and expected counts μ = (0.1, 0.2, 0.8, 0.1, 0.5). The reward terms are log 0.8 + log 0.5 = −0.223 − 0.693 = −0.916. The charge is the sum of μ, which is 1.7. So L = −0.916 − 1.7 = −2.616 for these five bins.

When do the two options agree?

Take a neuron at 20 Hz. In a 1 ms bin, μ = 0.02. The Bernoulli chance of a spike is p = 0.02. The Poisson chance of at least one spike is 1 − e−0.02 = 0.0198. They agree to two digits. In a 25 ms bin, μ = 0.5, and Poisson allows two or more spikes with chance 1 − e−0.5(1 + 0.5) = 0.090. A Bernoulli coin cannot say that at all. As the bins shrink, the two models become one. Pick a rate and a bin size below.

Coin or count?

Bars show the chance of 0, 1, and 2 or more spikes in one bin. The Poisson model (warm) can show several spikes. The Bernoulli coin (blue) has only 0 or 1.

20
1

Exact formulas. Poisson: mean μ = rate × bin. Bernoulli: p = min(μ, 1), the simplest matching coin. Both are illustrative models of one bin, not of a particular cell.

In practice, use bins of 1 to 10 ms. Either model works there, and the Poisson form is easier to compute: it needs no log(1 − p) and the rate stays positive with a plain exponential. That is the form the rest of this lesson uses.

Units and the missing dt

One failure appears often when people first write this score. They forget the bin width. If the rate is in spikes per second and the bin is 5 ms, then the expected count in a bin is λ × 0.005. Use λ directly and the fit reports rates that are 200 times too small or too large, depending on which side you forgot. The symptom is a fitted base rate of 0.05 for a cell that clearly fires at 10 spikes per second. The measurement is a check of total spikes: the sum of μ over all bins should equal the number of recorded spikes. The fix is to put dt in the expected count.

That check is worth keeping. At the maximum likelihood fit of a Poisson GLM with a baseline column, the sum of predicted counts equals the sum of real counts exactly. It is a free test of your code. If the two sums differ, something upstream is wrong.

In the Poisson log likelihood L = ∑ y log λ − dt ∑ λ, what does the second term do?

Chapter 7

Fitting: Climb a Bowl-Shaped Score

Find the filter weights by walking uphill on the log likelihood, and see why the exponential bend guarantees one summit

The Gaussian model of Chapter 3 had a closed-form answer: one line of linear algebra. The Poisson model with an exponential bend does not. Set its derivative to zero and you get an equation with k trapped inside an exponential. No formula solves it. The lecture gives the fallback in a parenthesis: use gradient ascent to find the maximum.

The uphill direction

Gradient ascent is a hiker in fog. You cannot see the summit, but you can feel the slope under your feet. Step in the steepest uphill direction, then feel again. The slope of the log likelihood with respect to the weights is its gradient. Let us compute it for the Poisson GLM with an exponential bend, where μt = exp(xt·k) is the expected count in bin t. The log likelihood from Chapter 6 becomes:

L(k)
The score of the filter k, with constants dropped.
∑t
Add over all bins.
y (x·k)
The log of the rate is x·k, so this is y log μ. It rewards a high filter output where a spike came.
exp(x·k)
The expected count μ. It is the charge for predicting spikes.

Differentiate with respect to k. The first term gives ytxt. The second gives μtxt. So the gradient is ∑t (yt − μt)xt, or in matrix form XT(y − μ). Read it in words: for each bin, take the miss (real count minus predicted count) and multiply it by the stimulus window that bin saw. A bin that fired more than predicted pulls the filter toward its stimulus. A bin that fired less pushes it away. At the summit, the misses and the stimuli cancel exactly.

The Gaussian gradient is XT(y − Xk), the same shape: miss times input. The exponential bend is the Poisson’s canonical choice, the lecture notes, partly because it keeps the gradient this clean.

Why there is only one summit

A fog hiker can end on a small hill that is not the highest. Here that cannot happen. Differentiate once more. The curvature, the second derivative, is the matrix −XTdiag(μ)X. For any direction z, the curvature along it is −∑t μt(xt·z)². Every term is a positive number with a minus sign in front. So the curvature is never positive in any direction. The surface is a concave bowl turned upside down, with a single top.

The general rule is proven in Paninski (2004, Network), cited in the Field Guide. That paper gives a simple condition on the nonlinearity under which the likelihood has no non-global local maxima. The exponential satisfies it, which is why Poisson GLMs are easy to fit. We show the proof for the exponential only, since we derived it above.

A worked climb

One weight, three bins. The stimulus values are x = (1, 2, −1) and the counts are y = (1, 2, 0). The model is μ = ekx. At k = 0 every μ is 1 and L = −3.00. The gradient is 1·(1 − 1) + 2·(2 − 1) + (−1)·(0 − 1) = 0 + 2 + 1 = 3. It is positive, so raise k. With a step size of 0.1, the new k is 0 + 0.1 × 3 = 0.30. Repeat: k = 0.3747, then 0.3748. The weight settles at 0.375, where L rises from −3.00 to −2.38 and the gradient is zero. The same loop, run over thousands of bins and nine weights, is what the device below does.

Fit the filter by walking uphill

Left: the true filter (green) and your fitted filter (warm). Right: the score at each step. Pick a step size and press Run. Then try the largest step.

Simulated data, seeded: 3,000 bins of white-noise stimulus, 8 lags, a made-up biphasic filter, Poisson counts with rate exp(−2.8 + x·k), about 520 spikes. The fit starts at zero weights. The score is the mean log likelihood per bin, constants dropped.

Look at the three step sizes. A small step (0.3) climbs safely but needs about 40 steps. A good step (2) arrives in about 8. The large step (6) overshoots. The symptom is the score falling instead of rising. The measurement is the filter weights jumping to huge values in a few steps. The reason: the exponential grows so fast that one overshoot makes μ enormous, and the next gradient is enormous too. The fix is a smaller step, a line search that halves the step until the score rises, or a second-order method (Newton or IRLS) that uses the curvature to size each step. Standard libraries do the last.

A faster climb: Newton’s method

Gradient ascent uses only the slope. Newton’s method uses the curvature too. On the three-bin example the slope at k = 0 is 3 and the curvature is −6. Newton divides one by the other and steps by 3/6 = 0.5. The next iterates are 0.3874, 0.3750 and 0.3748. Three steps reach 0.3750 and no step size had to be chosen. Gradient ascent with a step of 0.1 did as well on this tiny case, but its step size had to be picked, and a wrong pick diverges, as the Chapter 7 device shows.

For a real filter the same idea needs the whole curvature matrix. With p weights it is p × p, and solving with it costs about p3 operations. For 20 weights that is trivial. For 2,000 weights it is about 8 billion operations per step, still fine on a laptop for a handful of steps. Because the surface is concave, the full Newton step is safe near the peak; far from it, libraries shrink the step with a line search. The code in the Field Guide uses exactly this loop.

During gradient ascent on a Poisson GLM, the score drops after every step and the weights grow huge. What is the most likely cause?

Chapter 8

Spike History: Refractory, Adapting, Bursting

Give the neuron a memory of its own spikes, and see one small filter produce four different firing styles

Hold the stimulus fixed and a real neuron still does not spike like a Poisson process. Right after a spike, it goes quiet for a few milliseconds. A neuron that fires fast for a second slowly tires. Some cells fire in tight bursts, then rest. A model that sees only the stimulus can explain none of this.

The lecture names the stimulus-only model linear-nonlinear-Poisson (LNP): a stimulus filter, an exponential bend, then Poisson spikes. Its output is a Poisson process, and the lecture states the flaw plainly: it assumes spiking depends only on the stimulus.

Add a filter on the neuron’s own past

The fix, from Truccolo and colleagues (2005), is to feed the neuron’s own recent spikes into the filter output. Add a second filter h, the post-spike filter (also called the spike-history filter). It looks back over the last M bins of the neuron’s own spike train:

λt
The conditional intensity in bin t: the firing rate given the stimulus and the neuron’s own recent spikes.
b
The baseline: the log of the rate when nothing drives the cell.
k·xt
The stimulus drive from Chapter 5.
h·y
The history drive. Each past spike at lag l adds the weight hl to the log rate.

The exponential turns the sum into a product (Chapter 4). A past spike at lag l multiplies the rate by exp(hl). A negative weight cuts the rate. A positive weight raises it. The output is no longer a Poisson process, since each spike changes the odds of the next. The lecture also calls it an autoregressive (AR) model. Another view from the lecture: the model is a soft-threshold integrate-and-fire neuron. In a classic integrate-and-fire cell the input builds up and the cell spikes at a hard threshold. Here the exponential bend makes the threshold soft: the chance of a spike rises smoothly.

Four styles from one filter

The lecture, following Weber and Pillow, shows that changing only the shape of h gives four behaviours. A worked case for a refractory filter, hl = −5·exp(−(l−1)/4) on 2 ms bins. Take a drive that would give 80 Hz. A spike 2 ms ago (lag 1) multiplies the rate by e−5 = 0.0067, so the rate is 0.54 Hz. A spike 10 ms ago (lag 5) multiplies it by e−1.84 = 0.16, so 12.7 Hz. A spike 24 ms ago (lag 12) gives a factor of 0.73, so 58 Hz. The cell is silent just after a spike and recovers over about 25 ms. That makes spikes more regular than Poisson.

A long, shallow negative filter gives adaptation: each spike slightly lowers the rate for the next 100 ms, so a sustained burst of input first fires fast, then settles lower. A filter that is positive for 4 ms and then negative gives bursting: a spike makes another more likely at once, then the cell rests. With no filter you get irregular Poisson-like firing. Try all four. A stimulus switches on at 0.5 s and off at 2.5 s.

One filter, four firing styles

Top: the history filter (up means a past spike raises the rate). Middle: five trials, the shaded zone is the stimulus step. Bottom: the gaps between spikes. Choose a filter, then draw new trials.

Illustrative filters, not fitted to a cell. 2 ms bins, 3 s per trial, base rate 8 Hz, stimulus step to 10 times that rate. Statistics come from 12 simulated trials. The gap spread (CV) is the standard deviation of the gaps divided by their mean; Poisson gives about 1.

What this changes for fitting

Fitting needs no new idea. Add the lagged spike counts as extra columns of the design matrix. If the stimulus has L lags and the history has M, X now has shape T × (L + M + 1), where the 1 is a column of ones for the baseline b. The Poisson log likelihood is still the Chapter 6 formula, and still concave in all the weights, so Chapter 7’s climb still works. The recorded spikes serve as the past, so the history columns are known when we fit.

The failure mode is easy to name. Fit a refractory cell without a history filter. The symptom: the model emits spikes 2 ms apart, which the cell never does. The measurement: compare the gap histogram of the model with that of the data, and the model has a tall bar at the shortest gaps that the data lacks. The fix: add the history filter. The fitted h then shows a deep dip for the first few lags, a direct read of the refractory period.

How far can one GLM go?

The lecture closes the topic by comparing the GLM with the Izhikevich neuron, a small dynamical model made to reproduce many firing styles. Weber and Pillow (2017) tested whether a Poisson GLM could mimic a long list of canonical behaviours. They report that it can reproduce tonic and phasic spiking, bursting and spike-rate adaptation, among others. So one family, with filters of different shapes, covers a wide range of single-cell behaviour.

For a brain-computer interface the lesson is practical. A cell that bursts or adapts is not noise to average away. It carries structure that a history filter can model, and a decoder that uses a good encoding model can use it too. The price is more weights to fit, so the need to hold out data and to penalise the weights grows with the length of the history window.

A fitted post-spike filter is strongly negative for the first 8 ms, then returns to zero. What does it say about the cell?

Chapter 9

Coupling and Simulating Spikes

Let neurons hear each other, draw new spikes bin by bin from the fitted model, and check the model against the cross-correlation

An electrode array hears many neurons at once. Two neurons next to each other often fire close together in time, more than chance allows. A model that fits each cell alone misses this. Yet a brain-computer interface reads the whole population. We need a model of the group.

One more filter: who spoke just before me?

Pillow and colleagues (2008, Nature) fitted a GLM to a nearly complete patch of macaque retina: 27 ON and OFF parasol retinal ganglion cells, recorded in vitro, with a binary white-noise stimulus refreshed at 120 Hz. Each cell's model has three filters inside the exponential bend. The first is the stimulus filter (its receptive field). The second is the post-spike filter of Chapter 8. The third is new: one coupling filter for each other cell, which weighs that cell’s recent spikes. The rate of cell i becomes:

λi,t = exp( bi + ki·xt + hi·yi,past + ∑j≠i cij·yj,past )

Read the new sum as a vote. Each neighbour j has a filter cij that says how a recent spike of j pushes the log rate of i up or down. The paper fitted the model by penalised maximum likelihood, with an L1 penalty on the coupling filters. That penalty drives unneeded filters to exactly zero, so only the connections the data demand survive. For 27 cells this is 27 × 26 = 702 coupling filters, and 351 cell pairs.

The reported results are specific. The coupled model reproduces the cross-correlation function of all 351 pairs, including sharp peaks of near-synchrony that an uncoupled model misses. Using the coupled model for Bayesian decoding extracted about 20% more information about the stimulus than decoding that assumed the cells were independent. This is a retina result, not a brain-computer interface result. It shows what the model class can do, and that correlations between cells carry information.

Simulating spikes: one bin at a time

A fitted GLM is a generator. To draw new spikes, start with all history zero. In bin 1, compute the rate from the stimulus. Draw a spike or none with the rate. In bin 2, compute the rate again, now including the spike you just drew. Draw. Continue to the end. The loop must run in time order, because each draw changes the odds of the next. You cannot draw all bins at once. In code:

y = np.zeros(T)
for t in range(T):
    u = b + X_stim[t] @ k                          # stimulus drive
    u += sum(h[l] * y[t - 1 - l] for l in range(M) if t - 1 - l >= 0)   # own history
    lam = np.exp(u) * dt                           # expected count in this bin
    y[t] = np.random.poisson(lam)                  # draw the spikes for bin t

Why simulate? It is the model’s honest test. If the model is good, its simulated spike trains should look like the recorded ones in every statistic you can compute: average rate over time, gap histogram, and the cross-correlation between cells. A statistic that differs points at a missing piece. A fast peak that the model lacks means a missing coupling filter.

Match the cross-correlogram

The cross-correlogram answers one question: when cell A fires, how often does cell B fire a few milliseconds before or after? The lines below show B’s rate, in spikes per second, at each time offset from an A spike. A flat line at B’s average rate means the cells ignore each other. The blue curve is a stand-in “recording” with a real coupling. Drag the coupling weight of your model until the warm curve matches it.

Fit the coupling by simulation

Horizontal: B’s spike time minus A’s. Vertical: B’s rate. Blue is the stand-in data. Warm is your simulated model. Drag the weight so the warm peak reaches the blue peak.

0.0

Illustrative simulation, not a recording: A fires at 15 Hz. B has a 15 Hz base rate, a refractory filter and a coupling filter w × exp(−lag/10 ms) on A’s spikes. The stand-in data use w = 1.4 and 40 s of 2 ms bins. Your model uses a different random seed.

When w is 0, the warm line sits flat at 15 Hz, as an uncoupled model must. As you raise w, a peak grows just after offset 0: B is more likely to fire right after A fired. Push w above the true value and the warm peak overshoots. A negative w digs a trough instead, the sign of inhibition. In real data you do not search by eye. The same likelihood from Chapter 6, with the coupling columns added to X, finds the weights, and the simulation is the check.

From encoding model to decoder

Why build a model of the spikes when a BCI wants to read intent from them? Because Bayes’ rule turns the encoding model around. The chance of a stimulus given the spikes is proportional to the chance of the spikes given the stimulus, times a prior over stimuli. The first factor is the likelihood of Chapter 6, now read as a function of the stimulus (the “stimulus likelihood” of Chapter 2). Pick the stimulus that makes the recorded train most probable, or combine it with a prior.

The coupling terms matter here for a clear reason. A decoder that assumes independent cells multiplies their likelihoods. That is wrong when cells are coupled, and Pillow and colleagues found that the cost in the retina was about 20% of the available information. Whether the same figure applies to cortical recordings is a separate question that this paper does not answer.

Why must you draw simulated spikes bin by bin in time order, and not all at once?

Chapter 10

Field Guide: The Point-Process GLM on One Page

Keep the numbers, the checklist and the working code, and see where the model sits among the other BCI tools

A spike train is a row of small counts. A Poisson GLM gives each bin a rate: a stimulus filter, a spike-history filter and an optional coupling filter add up inside an exponential. The log likelihood is a sum with a reward for each spike and a charge for each unit of rate. It is concave, so gradient ascent or Newton’s method finds the one best answer. Simulating the fitted model, bin by bin, tests it.

QuantityValueWhere
Poisson lawP(y = k) = λke−λ/k!; mean = variance = λChapter 1
Poisson MLE of a ratethe average count; for counts 3, 5, 4, 6, 2 it is 4Chapter 2
Least squaresmaximum likelihood under Gaussian noise; k̂ = (XTX)−1XTYChapter 3
Canonical bendsidentity (Gaussian), logistic (Bernoulli), exponential (Poisson); softplus is commonChapter 4
Design matrix shapeT × L (bins by lags); 60,000 × 20 for 5 min at 5 msChapter 5
Poisson train log likelihood∑ y log λ − dt ∑ λChapter 6
Coin vs countat 20 Hz in 1 ms bins: 0.0200 vs 0.0198; in 25 ms bins Poisson gives 9.0% to two or moreChapter 6
Gradient and curvatureXT(y − μ) and −XTdiag(μ)X, never positiveChapter 7
Refractory examplerate × 0.0067 at lag 2 ms, × 0.16 at 10 ms, × 0.73 at 24 msChapter 8
Pillow et al. 2008 (paper's numbers)27 retinal cells, 351 pairs, about 20% more information from coupled decodingChapter 9

A checklist for a new fit

  1. Pick the bin. Use 1 to 10 ms. Check that almost every bin holds 0 or 1 spike.
  2. Build the columns. Stimulus lags, spike-history lags, then a column of ones. Never use future stimulus.
  3. Choose the bend. Use the exponential unless you have a reason. It keeps rates positive and the score concave.
  4. Fit. Use Newton or a library routine. If you use gradient ascent, watch the score for a fall.
  5. Simulate and compare. Check the average rate over time, the gap histogram and the cross-correlogram.
  6. Hold out data. Score on spikes the fit never saw. Add a penalty when the weights outnumber the spikes.
import numpy as np
rng = np.random.default_rng(0)
T, L, dt = 20000, 8, 0.005                               # bins, stimulus lags, bin size (s)
s = rng.standard_normal(T + L)                           # white-noise stimulus
X = np.stack([s[i:i + L][::-1] for i in range(T)])       # design matrix, shape (T, L)
k_true, b_true = np.array([0, .5, 1, .6, -.2, -.6, -.3, -.1]), np.log(10.0)
y = rng.poisson(np.exp(X @ k_true + b_true) * dt)        # simulate counts, shape (T,)

A = np.c_[X, np.ones(T)]                                 # add the baseline column
w = np.zeros(L + 1); w[-1] = np.log(5.0)                 # start at 5 Hz
for it in range(300):
    mu = np.exp(A @ w) * dt                              # expected counts per bin
    grad = A.T @ (y - mu)                                # gradient of the log likelihood
    H = -(A * mu[:, None]).T @ A                         # Hessian, never positive
    w -= np.linalg.solve(H, grad)                        # Newton step
    if np.abs(grad).max() < 1e-6: break
print(np.round(w[:L], 2), round(float(np.exp(w[-1])), 1))   # recovers the filter and about 10 Hz

We ran this code. It recovers the filter (0, 0.5, 1.0, 0.6, −0.2, −0.6, −0.3, −0.1) to within 0.04 and the base rate as 10.2 Hz. To add spike history, append the lagged counts of y as more columns of A. To simulate, use the bin-by-bin loop from Chapter 9.

Where it sits in the field

The GLM is an encoding model: stimulus or movement in, spikes out. A decoder runs the other way. Chapters 15 and 16 of this series decode movement from rates with a linear map and a Kalman filter. A point-process decoder keeps the spike-by-spike likelihood of this lesson and uses it as the measurement model in a filter, with no binning into rates. Shared latent structure across many cells comes next, in latent variable models. The fuller general theory is in the site’s generalized linear models lesson, and spikes and rates start in spikes to rates.

Keep going

Sources

  1. Pillow, J. NEU 560, Statistical Modeling and Analysis of Neural Data, Princeton, Spring 2024: course site, Lecture 9 slides, Lecture 10 slides. This lesson follows their order and re-teaches every idea in its own words.
  2. Truccolo, W., Eden, U. T., Fellows, M. R., Donoghue, J. P., Brown, E. N. A point process framework for relating neural spiking activity to spiking history, neural ensemble, and extrinsic covariate effects. J Neurophysiol 93(2):1074-1089, 2005. doi:10.1152/jn.00697.2004.
  3. Pillow, J. W., Shlens, J., Paninski, L., Sher, A., Litke, A. M., Chichilnisky, E. J., Simoncelli, E. P. Spatio-temporal correlations and visual signalling in a complete neuronal population. Nature 454:995-999, 2008. doi:10.1038/nature07140. The 27-cell, 351-pair and 20% figures are from its open full text on PubMed Central.
  4. Paninski, L. Maximum likelihood estimation of cascade point-process neural encoding models. Network: Computation in Neural Systems 15:243-262, 2004. abstract. Used for the statement that a condition on the nonlinearity rules out non-global local maxima; the exponential case is derived in Chapter 7.
  5. Weber, A. I., Pillow, J. W. Capturing the dynamical repertoire of single neurons with generalized linear models. Neural Computation 29(12):3260-3289, 2017. arXiv:1602.07389. The source of the four firing styles in Chapter 8. Our filters there are made-up shapes, not theirs.
The takeaway. A spike train is a coin per bin. The coin’s bias is the exponential of a stimulus filter plus a spike-history filter. Fit it by climbing a bowl, then simulate it to see what it still misses.

Teach it back with Teach, or practise saying it aloud with Present. Then go back to the instrument at the top and see how a refractory filter changes the gaps.

The Point-Process GLM, BCI series lesson 18
Follows Princeton NEU 560 (Jonathan Pillow), course site · Back to Gleams