ΨPsychology, Built

Act XI · The Graduate Toolkit

Part 49 of 62

Modelling the Brain's Data

Researchstarts at this level32 min of film17 chaptersprerequisites: Part 8, Part 47, Part 48

What must be true for a brain map to be evidence?

In 2020 seventy teams analysed one brain-imaging dataset and answered the same questions differently. The part builds the analysis chain on a synthetic brain where the truth is known: 72 pipelines and 44 different maps, head motion that makes connections, fixed effects that treat scans as people, cluster inference that fails at lenient thresholds and permutation that does not, a decoder that reads noise at 94% when it peeks, representational geometry and encoding models judged against noise ceilings, anticorrelations made by global-signal regression, ERP windows chosen from the answer, the population vector, brain-computer interfaces and their bit rates, and the samples of thousands that brain-behaviour claims need.

What you need. Part 8's measurement chain; Part 47's multilevel models; permutation tests, ridge regression and principal components.

Hook
seventy teams, one dataset
Ideas, models and mathematics
the fMRI pipeline, random fields and clusters, decoding, representational similarity, encoding models, connectivity, ERP analysis, population codes, brain–computer interfaces, the sample-size problem
Psyche gains
psyche.neurodata on a synthetic brain
On you
how many analysis paths?

What you will be able to do

Psych 101 and the major

  • Explain why one dataset analysed through many defensible pipelines can give different answers.
  • Explain why a brain-behaviour correlation from a few dozen people is usually inflated.

Graduate

  • Fit a two-level model of brain data and threshold it by permutation, and explain when cluster inference fails.
  • Cross-validate a decoder with every selection step inside the loop, and compare a model with brain data by representational similarity against a noise ceiling.

Research

  • Plan a brain-behaviour study from the smallest effect of interest, the measures' reliabilities and a registered pipeline.

Practice

  • Audit a claim made for a neurotechnology product or a brain-based biomarker.

Contents

Each chapter has a home level. Choose a track to see what to read and watch: Psych 101 and the major 11 min · Graduate 13 min · Research 32 min · Practice 13 min.

  1. 0Seventy teams, one datasetPsych 101 and the major2 min
  2. 1On you: count the forks, and four numbersPsych 101 and the major1 min
  3. 2PreprocessingResearch2 min
  4. 3The linear model, at two levelsResearch2 min
  5. 4Thresholds at depthResearch3 min
  6. 5PatternsPsych 101 and the major2 min
  7. 6GeometryResearch2 min
  8. 7Encoding modelsResearch2 min
  9. 8ConnectivityResearch2 min
  10. 9EEG and MEGResearch2 min
  11. 10Populations of neuronsResearch1 min
  12. 11Reading outResearch2 min
  13. 12The sample-size reckoningPsych 101 and the major3 min
  14. 13The LedgerResearch1 min
  15. 14In practice: clinics, devices and claimsPractice2 min
  16. 15Frontier: foundation models and precision mappingResearch1 min
  17. Recap, problems, and the road aheadAll tracks3 min

Also on this page: Lecture · Key results · Try it · Lab · Problems · Notes and sources · Build the film.

Lecture

The text of each chapter is the film's narration, as it is spoken, so you can read along or revise without the film. The pictures are in the film.

Seventy teams, one datasetPsych 101 and the major2 min

In 2020, one brain-imaging dataset, from over a hundred people doing a gambling task, was given to seventy research teams. Each team got the same nine yes-or-no questions. Does this region respond to gains? To losses? No two teams chose the same analysis pipeline. And for several of the questions, some teams said yes and others said no, from the same data. The variation came from the analysis, not from the brains.

Psyche can do the same where the truth is known. A synthetic brain, thirty people, and five regions with planted effects, from none to large. Seventy-two defensible pipelines: three amounts of smoothing, six thresholds, two exclusion rules, and with or without a covariate. Each column is a pipeline, each row a question, and gold means yes. Where nothing was planted, every pipeline says no. For the largest effect, about three quarters say yes. In between, the pipelines split. Seventy-two pipelines gave forty-four different maps.

So this part asks what must be true for a brain map to be evidence. The pipeline: preprocessing, the model at two levels, and thresholds. Patterns: decoding, geometry, and encoding models. Connections, waves, and populations of neurons. And reading the brain out, and how many people a claim needs.

This is Part 49 of Psychology, Built: modelling the brain's data. We'll walk the analysis chain and count its forks. We'll fit the model at two levels and see why subjects must be a sample. We'll test clusters by permutation and control false discoveries. We'll decode patterns, compare geometries, and fit encoding models against a noise ceiling. We'll see what motion does to connectivity, what choosing a time window does to an ERP, and how a population of neurons codes a movement. And we'll read the brain out, and ask how many people a brain-behaviour claim needs.

What it does: The seventy teams; the multiverse on Psyche's brain; the question; objectives

1On you: count the forks, and four numbersPsych 101 and the major1 min

First, count the forks yourself. Here are ten ordinary choices in analysing one brain scan, each with two to four defensible options: slice timing, motion correction, motion regressors, scrubbing, the template, smoothing, the response model, the filter, the threshold and the software. Multiply them. Six thousand nine hundred and twelve pipelines. In 2012 Joshua Carp ran thousands of pipelines like these on one dataset, and the maps differed in where, and whether, effects appeared. On the course site you can make each choice yourself and watch the map change.

Now four numbers. One: seventy-two defensible pipelines run on one dataset. How many different maps come out? Two: pure noise, a thousand voxels. Choose the fifty best voxels using all the data, then cross-validate a decoder. What accuracy does it report? Three: a true brain-behaviour correlation of zero point one, studied with twenty-five people. Among the significant results, what's the average correlation reported? And four: how many people does it take to have eighty percent power for a correlation of zero point one? Pause here, and write them down.

What it does: Ten choices, 6,912 pipelines; four predictions

2PreprocessingResearch2 min

Before any statistics, four steps. Slice timing. A volume is taken slice by slice, over a second or two, so each slice's series is shifted to a common time. Motion correction. Every volume is realigned to the first, and the movement estimates are kept, because realignment can't undo everything motion did. Registration. Each brain is mapped onto a template, so that a voxel means the same place in everyone. And smoothing: a blur a few millimetres wide, which cuts noise and helps people overlap, at the price of coarser maps. Every step has options, and each option is a fork.

Motion matters most where people differ. Psyche makes eighty people with identical brains. Half move their heads more, in brief jerks. A jerk changes the signal in nearby regions together, so near pairs look more connected in the movers, and far pairs a little less. Any group that moves more, such as children, patients, or older adults, shows a finding that's only motion. Remove the moving scans, and the difference vanishes. Jonathan Power and colleagues found exactly this pattern in real data in 2012, and some published differences in connectivity had to be revisited.

How wide should the blur be? Take the same seventy-two pipelines, split by how much they smooth. The planted regions are discs eight voxels across, and the blur is measured in voxels too. Here, no smoothing finds the middle-sized effects most often. A blur wider than the region spreads its signal into the silent tissue around it, and even the largest effect is found by fewer than a third of the widest-blur pipelines. The right kernel depends on the size of what you're looking for. It's the matched-filter rule from signal processing.

What it does: Four steps; head motion makes connections; how wide a blur?

3The linear model, at two levelsResearch2 min

The model has two levels, like Part 47's. Part 8 fitted the first: each voxel's time series against the task, convolved with the haemodynamic response. Each person then gives one contrast per voxel, such as faces minus houses. The second level treats people as a sample. The test's error is how much that contrast varies across people. It's Part 47's multilevel model, with voxels in place of trials.

Here it is on Psyche's brain. On the left, what was planted: five discs with effects from none to large. In the middle, one person's map. It's mostly that person, and noise. On the right, the group's t map from thirty people. The large effects stand out plainly, the middle ones faintly, and the smallest not at all. Thirty people are enough for some questions and not for others, which is why the pipelines split where they did.

Why must the second level use the spread across people? Take twenty people and no group effect at all. But each person's true effect differs, and each is measured with some error. A fixed-effects test uses only the measurement error, as if the scans were the sample. Fourteen percent of null voxels pass at one in a thousand. A random-effects test uses the spread across people, and gets one in a thousand, as promised. Fixed effects describes these twenty people. Only random effects speaks for the population they came from. Early imaging studies often used fixed effects.

What it does: Two levels; one person and thirty; scans are not people

4Thresholds at depthResearch3 min

Part 8 met the thresholding rules. Here are four of them on one group map: gold where they're right, red where they're wrong. A per-voxel threshold controls each test, not the map. The false discovery rate controls the share of the declared voxels that are false. Cluster rules ask whether a blob is bigger than noise makes blobs. And permutation asks what the largest t would be if nothing were there. Same data, four maps, and none of them finds every planted voxel.

Permutation lets the data make its own null. If there's no effect, each person's contrast map is as likely to point up as down. So flip the signs of a random subset of people, and recompute the whole t map. Record the largest t, or the largest cluster, anywhere in the brain. Do it thousands of times, and the ninety-fifth percentile of those maxima is the threshold. No assumption about how the noise is correlated in space is needed. The brain's own noise sets the bar.

Now the failure that shook the field. Psyche makes two hundred group studies of pure noise, whose spatial correlation has a long tail, as real noise does. Calibrate cluster sizes on Gaussian noise and form clusters at one in a hundred, and a cluster appears in about one study in eight, against the promised one in twenty. At one in a thousand it's close to the promise, and permutation holds both near five percent. In 2016 Anders Eklund, Thomas Nichols and Hans Knutsson ran null analyses on real resting-state data in common software, and found far larger excesses at the lenient threshold. That's in the Ledger.

And the threshold is a fork. Here's the share of pipelines saying yes, by threshold rule, for the five questions. For the empty region and the smallest effect, every rule agrees: no. For the middle effects, the rule alone moves the answer: from none to a third of the pipelines for one, and from two fifths to two thirds for the other. A threshold is a decision about which errors to risk. Choose it before the data, and say which.

What it does: Four rules on one map; permutation; cluster failure, simulated; the threshold is a fork

5PatternsPsych 101 and the major2 min

Mass-univariate maps test each voxel alone. Patterns ask what many voxels say together. In 2001 James Haxby and colleagues showed people faces, houses, chairs, shoes, and four other categories. They split each person's data in half, and asked whether a category's pattern in one half matched the same category in the other half better than the rest. It did, across ventral temporal cortex, and it still did with the most selective voxels taken out. The information was spread out, a pattern and not only a blob. Modern decoders train a classifier on some trials and test it on others. That's cross-validation, and it's where the trouble starts.

Here's how a decoder can read noise. Two categories, forty trials each, a thousand voxels, and a simple decoder tested by five-fold cross-validation. On pure noise, using every voxel, it scores about fifty percent: chance. Now pick the fifty voxels that differ most between the categories, using all the trials, and only then cross-validate. Ninety-four percent, from nothing. The test trials helped choose the voxels. Pick them inside each training fold only, and it's back to chance. With a real but weak signal, the honest decoder finds about two thirds. Any step that sees the test data, selection, scaling or tuning, belongs inside the loop.

So what does decoding show? That the information is present in the region's activity, in a form a linear readout can use, and how far it generalizes: across runs, across people, or from seeing to imagining. It doesn't show that the brain uses the information. A confound such as eye movements or reaction time can carry the label. It doesn't show that the region computes it, since the information may be inherited from elsewhere. And it doesn't show what the representation is. That's the next chapter's question.

What it does: From blobs to patterns; decoding noise at 94%; what decoding shows

6GeometryResearch2 min

Geometry asks a different question: not where, but what shape. In 2008 Nikolaus Kriegeskorte, Marieke Mur and Peter Bandettini proposed representational similarity analysis. For every pair of stimuli, how different are the region's patterns? The table of those distances is the representational dissimilarity matrix. The same table can be made from a model, from behaviour, like Part 22's similarity judgments, from a monkey's neurons, or from a layer of a neural network. Compare the tables, and very different measurements meet. No voxel has to be matched to a neuron.

Psyche makes a region where the answer is known. Twenty-four stimuli in four categories of six, and a size that varies within each category. Each table is twenty-four by twenty-four, and dark means similar. The region's table, averaged over twelve people, shows four dark blocks, the categories, and inside each block a gradient, the size. The two model tables say what each idea predicts.

So how good is each model, and how good could any model be? The category model correlates about zero point six four with each person's table, the size model about zero point four five. The grey band is the noise ceiling: how well the group's own table predicts each person, here about zero point nine. No model can beat that. A model near it explains everything the data can show. Here neither model reaches it, because the region holds both. A model of category and size together would do better.

What it does: Distances, not voxels; three tables; the noise ceiling

7Encoding modelsResearch2 min

Encoding models turn the arrow around. Decoding goes from the brain to a label. Encoding goes from features of the stimulus to each voxel. The features are a theory: edges and orientations, the meanings of words, or a layer of a neural network. The weights are fitted with a penalty, ridge regression, on some stimuli, and the model is judged only on stimuli it has never seen. Thomas Naselaris and colleagues set out the framework in 2011. A model earns its keep by prediction.

Psyche builds a case where the true features are known. Three hundred voxels, forty stimulus features, trained on three hundred stimuli and tested on sixty new ones, each shown twice. Each voxel's noise ceiling is how well one showing of the test stimuli predicts the other. No model can do better than the data agree with themselves. For responsive voxels, the model reaches a median correlation of about zero point seven eight, near their ceiling. The grey voxels respond to none of the features: low ceilings, and nothing to predict. Real models fall well below their ceilings, and the gap is what the theory is missing.

Encoding models made a striking map. In 2016 Alexander Huth and colleagues played hours of stories to a handful of people in the scanner. Each word was described by its meaning, as a list of numbers, and each voxel got its own weights. The weights tiled much of cortex with patches tuned to kinds of meaning: people, places, numbers and more, in both hemispheres. These are maps from a few people, each scanned for hours: precise for them, and an open question for everyone else. The same method maps Part 23's language network, and it's how today's language models are compared with brains.

What it does: Predicting the brain from the stimulus; the noise ceiling; maps of meaning

8ConnectivityResearch2 min

Some of the most reproducible findings come from people doing nothing. In 2001 Marcus Raichle and colleagues noticed regions whose activity fell during almost any goal-directed task, medial prefrontal and posterior cingulate cortex among them. They called it a default mode of brain function. In 2003 Michael Greicius and colleagues found that the same regions' slow fluctuations were correlated at rest, with no task at all. Thousands of resting scans later, cortex divides into a handful of large networks, reproducibly, and the default network is one of them. What it does, memory, imagining, or thinking about oneself and others, is still argued.

Connectivity has its own forks. Psyche makes two networks, each with its own signal, plus a global signal shared by every region. Nothing is anticorrelated with anything. Raw, regions within a network correlate about zero point four seven, and between networks about zero point one four. Now regress out the brain's mean signal, a common cleaning step. Between the networks, the correlation becomes about minus zero point two seven. Removing the mean forces the correlations to average about zero, so some must turn negative. Kevin Murphy and colleagues showed this in 2009, and whether the default network is anticorrelated with attention networks became a matter of this one choice.

So what can a correlation between two regions mean? A direct connection: possible, but not required. A common input: both regions driven by a third, by the task, or by breathing and heartbeat. A shared artefact: motion, the global signal, or the scanner. And direction: correlation has none, and lagged methods on slow fMRI signals are unreliable for it. A connectivity map is a map of shared fluctuation. Causal claims need the interventions of Part 8.

What it does: The brain at rest; anticorrelations made to order; what a correlation can mean

9EEG and MEGResearch2 min

EEG and MEG trade space for time. ERPs average many trials locked to an event. The noise falls with the square root of the count, as Part 8 showed, and a component is measured by its amplitude or latency in a window of time. Time-frequency analysis gives the power at each frequency over time. Alpha, around ten cycles a second, falls when attention is engaged. Source estimation runs from scalp voltages back to sources. It's ill-posed, as Part 8's silent sources showed, so a prior chooses one answer among many. And MEG records the magnetic fields of the same currents, less blurred by the skull. Every one of these has its own forks, and the most common is the window.

Here's the most common fork in ERP research. Twenty-four people, two conditions with no difference at all, and two thousand simulated studies. Test a window fixed in advance, and five percent are false positives, as promised. Now look at the grand-average difference, put the window on its peak, and test there. Forty-five percent. It's Part 8's circular analysis, in time. Choose the window from the average of both conditions, which knows nothing about their difference, and it's back to five percent. Choose windows from prior studies, from an independent localizer, or from a collapsed average.

What it does: Three analyses beyond the average; choosing the window from the answer

10Populations of neuronsResearch1 min

Below the voxel are the neurons. In 1982 Apostolos Georgopoulos and colleagues found motor-cortex neurons broadly tuned to the direction of an arm movement. Each fires most for one direction, and less for others. Let each neuron vote for its preferred direction, weighted by how much it fires, and the sum of the votes points the way the arm moves. With Psyche's noisy neurons, four cells miss by more than forty degrees on average, and two hundred and fifty-six by about six. No single cell is precise. The population is.

Populations also have shapes. A hundred neurons, recorded during slow, wandering reaches: a hundred numbers at every moment. Principal components show that two dimensions hold over ninety percent of the variance. The rest is noise. Plotted in those two dimensions, the activity lives on a ring, the direction of the movement. It's called a neural manifold. In real recordings the manifolds are low-dimensional too, and their dynamics, not single cells, are what models of the motor cortex now try to explain.

What it does: The population vector; a neural manifold

11Reading outResearch2 min

Decoding becomes a device when it runs live. A brain-computer interface records, decodes and acts, and the person sees the result and adapts. With scalp EEG, spellers flash letters and detect the brain's response to the one being attended: slow, but needing no surgery. With electrode arrays in motor cortex, people with paralysis have moved cursors and robotic arms by intending to move. Recent work decodes attempted speech from the cortex of a person who can no longer speak, into text, with a language model's help. Each step is the population vector's idea, grown up: many noisy channels, one intended movement.

How good is a decoder? Engineers count bits. Jonathan Wolpaw's formula gives the information in one selection among N targets, made correctly with probability P. Divide by the time per selection. Two targets at ninety percent, four seconds each: about eight bits a minute. Four targets at eighty percent, three seconds each: about nineteen. Twenty-six letters at ninety-five percent, one and a half seconds each: about a hundred and sixty-seven. Typing is a few hundred. Accuracy near chance is worth almost nothing. The curve is steep at the top, so the last few percent matter most.

So what can be read out? Intended movements, including the movements of speech. What a person attends to, among options the system offers. And coarse categories of what's seen or imagined, from a model trained on that person, with their cooperation. Not thoughts at large, unbidden, from a stranger. Not much from a model trained on someone else, without long calibration. And not what a person declines to give: so far, a resisting participant defeats the decoders. Claims beyond that deserve the audit of chapter fourteen.

What it does: From a cursor to sentences; bits per minute; what is decoded and what is not

12The sample-size reckoningPsych 101 and the major3 min

Now the question that reorganized the field. Take a true correlation of zero point one between a brain measure and a behaviour. That's about as large as most brain-wide associations turn out to be. With twenty-five people, a study can find anything from minus zero point three to nearly zero point five. With four thousand, it lands near the truth. In 2022 Scott Marek and colleagues looked at samples of up to tens of thousands. Brain-wide associations were mostly this small, and thousands of people are needed to estimate them.

And here's what gets reported. With twenty-five people, about eight percent of studies are significant, and those report an average correlation near zero point four seven: nearly five times the truth. A significant result replicates, in a new sample of the same size, about six percent of the time. Eighty percent power for a correlation of zero point one needs about seven hundred and eighty people. The literature of small studies was a literature of winners' curses: Part 4's arithmetic, in the brain.

Small samples are half the problem. The other half is the ruler. Spearman's attenuation, from Part 3: the reliabilities of both measures cap the correlation. In 2020 Maxwell Elliott and colleagues found that the test-retest reliability of common task-fMRI measures averaged about zero point four. So a true correlation of zero point two, with a brain measure of reliability zero point four and a behaviour of zero point eight, is observed at about zero point one one. The remedies are longer scans per person, measures chosen for their reliability, and samples of thousands.

One more test of the methods themselves. In 2017 Eric Jonas and Konrad Kording took a chip whose workings are fully known, running three classic video games, and studied it the way neuroscientists study brains. Lesions: removing some transistors stopped one game but not the others, as if those transistors were for that game. Tuning curves, correlations between parts, and dimensionality reduction all produced plausible findings. None revealed how the chip actually computes. The lesson: methods have to be tested on systems where the answer is known. That's what this part's synthetic brain is for.

What it does: One correlation, five sample sizes; what gets reported; a noisy ruler; the microprocessor

13The LedgerResearch1 min

What the five have in common. Three replicated: a network found in every large sample, a pattern found in every lab, and the variability of analysis itself. Two failed, and both are failures of method: samples too small, and an approximation that didn't hold. Both were caught by testing methods where the truth was known, or with data large enough to know it. So here's the answer to this part's question. A brain map is evidence when the pipeline was fixed in advance, the threshold matches the noise, and the sample matches the size of the effect.

What it does: Five rows; what they have in common

14In practice: clinics, devices and claimsPractice2 min

Where do these analyses run? In the clinic: mapping language and movement before brain surgery, one patient at a time, with a validated, fixed pipeline, where a false negative has a cost. In device engineering: brain-computer interfaces are tested like medical devices, for accuracy, bit rate, stability over months, and the user's own goals. In consumer neurotechnology: headbands that claim to measure focus or calm, from a few dry electrodes whose signal is dominated by muscle and eye movement. And in data science: large shared datasets of thousands of people, with fixed pipelines and held-out samples, now the standard for brain-behaviour claims.

And here's a checklist for auditing any claim about the brain. Was the pipeline fixed before the data, and how many paths were tried? Is the test at the level of people, with a threshold that fits the noise? For a decoder: was every choice made inside the cross-validation loop, and could a confound carry the label? For a brain-behaviour claim: how many people, how reliable were the measures, and was it tested in a held-out sample? For a device: accuracy against chance, bits per minute, in whom, and for how long? And is the claim about what the method can show, or about what a person thinks?

What it does: Where the analyses run; auditing a claim about the brain

15Frontier: foundation models and precision mappingResearch1 min

Three frontiers. Foundation models of brain activity: networks trained on thousands of hours of recordings from many people, then adapted to new people and new tasks. They're promising, and they still have to be shown to beat simple baselines. Naturalistic stimuli: films and stories in place of flashing checkerboards, giving richer data for encoding models, at the cost of control. And precision mapping: many hours of scanning per person, giving individual maps that differ from the group average in where networks lie. It's Part 47's lesson, in the brain.

Open questions. Which analysis choices matter most, and can a field agree on defaults without freezing its methods? Is a group map, or a person's own map, the right object for a theory of the mind? What would it take for a brain measure to predict one person's behaviour well enough to use? And when a network predicts brain activity, what has been explained?

What it does: Three frontiers; open questions

Recap, problems, and the road aheadAll tracks3 min

First, your four numbers. Seventy-two pipelines gave forty-four different maps. A decoder that chose its voxels with all the data read pure noise at ninety-four percent. With twenty-five people, the significant correlations averaged about zero point four seven, when the truth was zero point one. And eighty percent power for that truth takes about seven hundred and eighty people. A brain map is a measurement made by a pipeline. Fix the pipeline, match the threshold to the noise, and match the sample to the effect.

Part forty-nine in twelve lines. One dataset, many pipelines, different answers. Preprocessing choices are forks, and head motion makes connections. The second level treats people as the sample. Lenient clusters fail, and permutation lets the noise set the bar. The threshold is a decision about errors. Decoders leak when any choice sees the test data. Geometry compares tables of distances, up to a noise ceiling. Encoding models are judged by prediction. Global-signal regression makes anticorrelations. Windows chosen from the answer give false positives. Populations code what single cells cannot. And brain-behaviour claims need thousands of people, and reliable measures.

Kant's wager. The first objection met group models, permutation tests, decoders and encoding models, all run on a brain whose truth was known. Green. The second met designed experiments with brains, and devices that act on a decoded intention. Green. And the third, about introspection. Brain data aren't reports, though what a region represents is still read through a model. Green.

Where this comes back. The weight of evidence across studies is next, in Part 50. The predictive brain is Part 58. Computational psychiatry, and its search for biomarkers, is Part 59. And brains and machines compared are Part 60.

Seven problems, with full solutions in this part's README. One counts pipelines. One computes a group t. One finds a Bonferroni threshold. One computes bits per minute. One attenuates a correlation. One explains a leak. And the last, with the star, asks you to plan a brain-behaviour study that would deserve to be believed. Pause here if you'd like to try them.

The books and papers behind this part are listed here and in the README. Poldrack, Mumford and Nichols teach the fMRI pipeline; Steven Luck's book is the standard for ERPs; and the seventy-team paper is the best single argument for registering an analysis.

Six parts of the graduate toolkit done. This one followed the brain's data from the scanner to the claim. Next, whole literatures. A regulator holds the registered results of seventy-four antidepressant trials, and the journals tell a different story. What does a literature say, and can it be trusted to say it? Part 50: the weight of evidence.

Where it goes next. Reading a whole literature is Part 50; the predictive brain Part 58; computational psychiatry's biomarkers Part 59; brains and machines compared Part 60.

Key results

The part's results in one place, for revision.

Random-effects t\(\displaystyle t_v = \bar c_v \big/ (s_v/\sqrt{n})\)
Permutation threshold\(\displaystyle u = q_{0.95}\big(\max_v t_v^{(\pi)}\big)\)
Attenuation\(\displaystyle r_{\text{obs}} = r\sqrt{\rho_{x}\rho_{y}}\)
Wolpaw's bit rate\(\displaystyle B = \log_2 N + P\log_2 P + (1-P)\log_2\tfrac{1-P}{N-1}\)

Try it

Lab 49 · Modelling the Brain's Data

Run the analysis choices that mislead on a brain whose truth is known: fixed effects, leaky decoding, windows chosen from the data, global-signal regression and small samples.

Figure produced by Lab 49: Modelling the Brain's Data
Produced by the lab below, seed 0, in 0.6 s.
python -m videos.psychology.labs 49 needs numpy, scipy, matplotlib · download lab49.py · source on GitHub
null voxels below p < .001: fixed effects; random effects               0.145; 0.0010
decoding noise: all voxels; selected inside folds; selected first       0.47; 0.46; 0.93
ERP false positives: fixed window; peak of difference; peak of average  0.068; 0.435; 0.070
between-network r: raw; after global-signal regression                  0.12; -0.27
population vector error (deg) with 4, 64, 256 neurons                   43.5, 9.2, 4.9
reported |r| among significant results at n = 25, 500, 4000             0.47, 0.13, 0.10

Each misleading choice looks reasonable in a single analysis; only a known truth, or a fixed plan, shows what it does.
The code (58 lines; it asserts its own result)
"""Lab 49: the brain's data: fixed against random effects, a leaky decoder, ERP windows chosen from the answer,
global-signal regression, the population vector and brain-behaviour correlations by sample size."""

import numpy as np

from videos.coursekit import labs
from explainer.psychology.psyche import neurodata as N

TITLE = "Modelling the Brain's Data"
GOAL = ("Run the analysis choices that mislead on a brain whose truth is known: fixed effects, leaky decoding, "
        "windows chosen from the data, global-signal regression and small samples.")
TASKS = [
    "Shrink the person-to-person spread (between = 0.2). How far do fixed effects' false positives fall?",
    "Select 200 voxels instead of 50 in the leaky decoder. Does the leak grow or shrink?",
    "Run the brain-behaviour simulation with a true r of 0.3. At what sample size do reported correlations stop "
    "being inflated?",
]


def run(seed=0):
    out = labs.Lab()
    fx = N.fixed_vs_random(reps=60, seed=seed + 1)
    assert fx["fixed"] > fx["random"]
    out.row("null voxels below p < .001: fixed effects; random effects", f"{fx['fixed']:.3f}; {fx['random']:.4f}")
    dc = N.decoding(trials=30, voxels=500, reps=20, seed=seed + 2)
    assert dc["leaky"] > dc["nested"]
    out.row("decoding noise: all voxels; selected inside folds; selected first", f"{dc['all']:.2f}; {dc['nested']:.2f}; "
            f"{dc['leaky']:.2f}")
    e = N.erp_windows(reps=400, seed=seed + 3)
    out.row("ERP false positives: fixed window; peak of difference; peak of average",
            f"{e['a_priori']:.3f}; {e['double_dip']:.3f}; {e['orthogonal']:.3f}")
    g = N.global_signal(seed=seed + 4)
    out.row("between-network r: raw; after global-signal regression", f"{g['between_raw']:.2f}; {g['between_gsr']:.2f}")
    p = N.population_vector_error(seed=seed + 5)
    out.row("population vector error (deg) with 4, 64, 256 neurons",
            ", ".join(f"{p['error_deg'][list(p['n']).index(k)]:.1f}" for k in (4, 64, 256)))
    b = N.bwas(true_r=0.1, seed=seed + 6)
    out.row("reported |r| among significant results at n = 25, 500, 4000",
            ", ".join(f"{b['reported'][list(b['n']).index(k)]:.2f}" for k in (25, 500, 4000)))

    out.note = ("Each misleading choice looks reasonable in a single analysis; only a known truth, or a fixed plan, "
                "shows what it does.")

    fig, ax = labs.figure(2, size=(11, 4.0))
    ax[0].bar(["all", "nested", "leaky"], [dc["all"], dc["nested"], dc["leaky"]],
              color=[labs.BLUE, labs.BLUE, labs.RED])
    ax[0].axhline(0.5, color="grey", ls=":")
    ax[0].set(title="decoding pure noise", ylabel="cross-validated accuracy")
    ax[1].plot(b["n"], b["reported"], "o-", color=labs.RED, label="reported |r| (significant)")
    ax[1].axhline(0.1, color="grey", ls=":")
    ax[1].set(xscale="log", title="the winner's curse in brain-behaviour studies", xlabel="people", ylabel="|r|")
    ax[1].legend()
    out.fig = fig
    return out


if __name__ == "__main__":
    print(run())

Now change it

  1. Shrink the person-to-person spread (between = 0.2). How far do fixed effects' false positives fall?
  2. Select 200 voxels instead of 50 in the leaky decoder. Does the leak grow or shrink?
  3. Run the brain-behaviour simulation with a true r of 0.3. At what sample size do reported correlations stop being inflated?

Problems, with solutions

Try each problem before opening its solution.

  1. Paths. A pipeline has 5 binary choices and 3 thresholds. How many paths? If each were an independent test at 5%, how likely is at least one false positive?

    Solution

    2⁵ × 3 = 96; if independent, 1 - 0.95⁹⁶ = 0.99. (Real paths are correlated, so the true chance is lower, but still far above 5%.)

  2. A group t. 20 people, a contrast with mean 0.3 and SD 1.0 across people. Find the random-effects \(t\).

    Solution

    t = 0.3/(1.0/√20) = 0.3 × 4.47 = 1.34, on 19 degrees of freedom: not significant.

  3. Bonferroni. A map has 50,000 voxels. Find the Bonferroni threshold for a familywise rate of 5%.

    Solution

    0.05/50,000 = 10⁻⁶ per voxel (z about 4.9).

  4. Bits. A 2-target interface is right 80% of the time, one choice every 2 s. Find bits per minute.

    Solution

    B = 1 + 0.8 log₂ 0.8 + 0.2 log₂ 0.2 = 1 - 0.258 - 0.464 = 0.278 bits per choice; 30 choices a minute give 8.3 bits per minute.

  5. Attenuation. A true correlation of 0.25; the brain measure's reliability is 0.5 and the behaviour's 0.9. Find the expected observed correlation.

    Solution

    0.25 × √(0.5 × 0.9) = 0.25 × 0.671 = 0.17.

  6. A leak. Why does selecting voxels on all the data before cross-validation inflate accuracy? Give the fix.

    Solution

    The test trials helped pick the voxels that happen to differ between the labels, so the test is no longer independent of the training; do every selection, scaling and tuning step inside each training fold.

  7. ★ A plan. Plan a brain-behaviour study of working memory and a fronto-parietal measure: sample size, reliability, pipeline, and a held-out test.

    Solution

    Choose the smallest correlation worth finding (say 0.15) and the measures' reliabilities; attenuate (with reliabilities 0.6 and 0.8, 0.15 becomes about 0.10), then size the sample for that (about 780 for 80% power, so use a shared dataset of thousands); register one pipeline, including motion censoring; fit in a discovery half and test once in a held-out half.

Notes and sources

Sources

  • R. Botvinik-Nezer et al., Variability in the analysis of a single neuroimaging dataset by many teams, Nature 582 (2020) 84-88; J. Carp (2012); R. Silberzahn et al. (2018).
  • R. A. Poldrack, J. A. Mumford and T. E. Nichols, Handbook of Functional MRI Data Analysis (Cambridge, 2011); T. E. Nichols and A. P. Holmes, Nonparametric permutation tests for functional neuroimaging, Human Brain Mapping 15 (2002) 1-25; K. J. Friston et al. (1994); C.-W. Woo, A. Krishnan and T. D. Wager (2014); A. Eklund, T. E. Nichols and H. Knutsson (2016).
  • J. D. Power et al., Spurious but systematic correlations in functional connectivity MRI networks arise from subject motion, NeuroImage 59 (2012) 2142-2154; K. Murphy et al., The impact of global signal regression on resting state correlations, NeuroImage 44 (2009) 893-905; M. E. Raichle et al. (2001); M. D. Greicius et al. (2003); B. T. T. Yeo et al. (2011).
  • J. V. Haxby et al. (2001, 2011); N. Kriegeskorte, M. Mur and P. Bandettini, Representational similarity analysis, Frontiers in Systems Neuroscience 2 (2008) 4; N. Kriegeskorte et al. (2008); T. Naselaris, K. N. Kay, S. Nishimoto and J. L. Gallant, Encoding and decoding in fMRI, NeuroImage 56 (2011) 400-410; A. G. Huth et al., Natural speech reveals the semantic maps that tile human cerebral cortex, Nature 532 (2016) 453-458.
  • S. J. Luck, An Introduction to the Event-Related Potential Technique (2nd edition, MIT Press, 2014).
  • A. P. Georgopoulos, J. F. Kalaska, R. Caminiti and J. T. Massey, On the relations between the direction of two-dimensional arm movements and cell discharge in primate motor cortex, Journal of Neuroscience 2 (1982) 1527-1537; J. R. Wolpaw et al., Brain-computer interfaces for communication and control, Clinical Neurophysiology 113 (2002) 767-791; F. R. Willett et al., A high-performance speech neuroprosthesis, Nature 620 (2023) 1031-1036.
  • R. Kanai and G. Rees (2011); W. Boekel et al. (2015); S. Marek et al. (2022); M. L. Elliott et al., What is the test-retest reliability of common task-functional MRI measures?, Psychological Science 31 (2020) 792-806; E. Jonas and K. P. Kording, Could a neuroscientist understand a microprocessor?, PLOS Computational Biology 13 (2017) e1005268.
About this partfrom its README

In 2020 seventy research teams were given the same brain-imaging dataset and the same nine yes-or-no hypotheses. No two teams chose the same analysis pipeline, and for several hypotheses their answers split. Part 8 built the measurement chain; this part builds the analysis chain on a synthetic brain where the truth is known, and then asks the question that reorganized the field: how many people does a brain-behaviour correlation need?

The viewer counts the forks in an ordinary pipeline (6,912 paths from ten choices) and predicts four numbers. Then the multiverse on Psyche's brain (72 pipelines, five regional hypotheses, 44 different maps); preprocessing, head motion as a distance-dependent confound in connectivity, and the matched-filter rule for smoothing; the linear model at two levels and why fixed effects mislead; thresholds at depth, permutation inference and cluster failure, simulated; decoding, and the leak that reads noise at 94%; representational similarity against a noise ceiling; encoding models judged by prediction; the default mode network and the anticorrelations global-signal regression makes; EEG and MEG, and ERP windows chosen from the answer; the population vector and a neural manifold; brain-computer interfaces and their bit rates; and the sample-size reckoning, attenuation by unreliable measures, and the microprocessor studied with neuroscience's methods.

What is computed and built
  • explainer/psychology/psyche/neurodata.py: group contrast maps with people as a sample, fixed and random effects, sign-flipping permutation for maximum t and cluster size, Gaussian-calibrated cluster extents, a 72-path multiverse, head motion's distance-dependent artefact and censoring, global-signal regression, cross-validated decoding with and without leakage, representational similarity with a noise ceiling, a ridge encoding model against repeat reliability, ERP windows chosen three ways, cosine-tuned populations with the population vector and principal components, Wolpaw's information rate, and brain-behaviour correlations by sample size with attenuation. Built on Part 8's synthetic brain (imaging). Tested in tests/psychology/test_neurodata.py.
  • The Ledger gains five rows; Part 8's small-sample declaration and Part 23's two declarations about Part 49 are resolved as notes.
  • The course's interactive: the reader chooses a pipeline (smoothing, threshold, exclusions) for Psyche's brain, predicts whether a region will light up, and sees the map and how many of the other pipelines agree.
Chapter notes
# Chapter What it does
0 Seventy teams, one dataset The seventy teams; the multiverse on Psyche's brain; the question; objectives
1 On you: count the forks, and four numbers Ten choices, 6,912 pipelines; four predictions
2 Preprocessing Four steps; head motion makes connections; how wide a blur?
3 The linear model, at two levels Two levels; one person and thirty; scans are not people
4 Thresholds at depth Four rules on one map; permutation; cluster failure, simulated; the threshold is a fork
5 Patterns From blobs to patterns; decoding noise at 94%; what decoding shows
6 Geometry Distances, not voxels; three tables; the noise ceiling
7 Encoding models Predicting the brain from the stimulus; the noise ceiling; maps of meaning
8 Connectivity The brain at rest; anticorrelations made to order; what a correlation can mean
9 EEG and MEG Three analyses beyond the average; choosing the window from the answer
10 Populations of neurons The population vector; a neural manifold
11 Reading out From a cursor to sentences; bits per minute; what is decoded and what is not
12 The sample-size reckoning One correlation, five sample sizes; what gets reported; a noisy ruler; the microprocessor
13 The Ledger Five rows; what they have in common
14 In practice: clinics, devices and claims Where the analyses run; auditing a claim about the brain
15 Frontier: foundation models and precision mapping Three frontiers; open questions
Recap, problems, and the road ahead Your numbers; twelve lines; Kant's three objections; payoffs; problems; references; Part 50
NotesWhere the numbers come from
What Source
The multiverse: 30 simulated people, five disc regions with planted group effects 0, 0.25, 0.45, 0.7, 1.1 (in within-person noise SDs), person-specific smooth departures (SD 0.6), long-tailed spatial noise and a head-motion artefact at the rim; 72 pipelines (smoothing 0, 4, 8 voxels; six thresholds; with or without the most-moving fifth excluded; with or without an age covariate): share saying yes 0%, 0%, 22%, 60%, 76%; 44 distinct thresholded maps; by smoothing, the 1.1 effect found by 100%, 100% and 29% of pipelines Psyche (neurodata.multiverse), item multiverse
Fixed against random effects: 20 people, no group effect, person effects SD 1, measurement SE 0.5: 13.9% of null voxels below p < 0.001 with fixed effects, 0.11% with random effects (200 simulated studies of 500 voxels) Psyche (neurodata.fixed_vs_random), item fixed
Four rules on one group map (4-voxel smoothing): 40, 44, 46 and 27 voxels declared by p < 0.001, FDR 5%, clusters formed at p < 0.01, and permutation max-t, of 196 planted voxels Psyche (neurodata.run_pipeline), item thresholds
Cluster failure: 200 null group studies (20 people) with long-tailed spatial autocorrelation; extents calibrated on Gaussian noise give a familywise rate of 12.5% at a p < 0.01 cluster-forming threshold and 6.5% at p < 0.001; sign-flipping permutation (200 per study) 4.5% and 6.0% Psyche (neurodata.cluster_fwe), item clusterfwe
Motion and connectivity: 80 identical brains, half moving more; movers minus still is +0.048 for the nearest region pairs and -0.004 for the farthest (slope -0.06 per unit distance); after censoring moving scans, about +0.002 everywhere Psyche (neurodata.motion_connectivity), item motion
Global-signal regression: two networks plus a shared global signal; within-network correlation 0.47, between 0.14; after regression 0.23 and -0.27 Psyche (neurodata.global_signal), item gsr
Decoding: 2 categories x 40 trials, 1,000 voxels, nearest-centroid, 5-fold cross-validation, 100 datasets: on noise 48% (all voxels), 49% (50 voxels selected inside folds), 94% (selected on all data first); with a 0.3-SD signal in a tenth of voxels 68%, 64%, 96% Psyche (neurodata.decoding), item decoding
Representational similarity: 24 stimuli in four categories, a size gradient within each; 12 simulated people; Spearman with the category model 0.64, with the size model 0.45; noise ceiling 0.88 to 0.90 Psyche (neurodata.rsa), item rsa
Encoding: 300 voxels, 40 features, ridge (penalty 10 by cross-validation), 300 training and 60 test stimuli shown twice: responsive voxels' median prediction r 0.78, median ceiling 0.83, median 94% of ceiling Psyche (neurodata.encoding), item encoding
ERP windows: 24 people, no difference, 2,000 studies: 5.6% significant with a window fixed in advance, 45.2% with the window at the difference's peak, 5.2% with the window at the average's peak Psyche (neurodata.erp_windows), item erp
The population vector: cosine-tuned Poisson neurons, 0.2 s windows: mean error 44, 26, 22, 14, 8, 6 and 6 degrees with 4, 8, 16, 32, 64, 128 and 256 neurons Psyche (neurodata.population_vector_error), item popvec
A neural manifold: 100 neurons during slow random reaching; the first two principal components hold over 90% of the variance Psyche (neurodata.manifold), item manifold
Bit rates by Wolpaw's formula: 8 bits a minute (2 targets, 90%, 4 s), 19 (4 targets, 80%, 3 s), 167 (26 letters, 95%, 1.5 s) Psyche (neurodata.wolpaw_itr), item itr
Brain-behaviour correlations, true r = 0.1, 4,000 studies per size: middle 95% -0.30 to 0.49 at n = 25 and 0.07 to 0.13 at n = 4,000; power 8%, 17%, 61%, 99.5%, 100% at 25, 100, 500, 2,000, 4,000; average reported |r| among significant results 0.47 at n = 25; a significant result replicates 6% of the time at n = 25; 783 people for 80% power; a true 0.2 with reliabilities 0.4 and 0.8 is observed at about 0.11 Psyche (neurodata.bwas, attenuated; imaging.n_for_correlation), items bwas, thresholds
Every published number on screen the studies listed under Sources, quoted as reported

The ten forks of chapter one and their option counts are illustrative of a standard fMRI pipeline; their product is the number Carp reported, chosen so. The descriptions of brain-computer interfaces and of Huth's maps are summaries without figures.

Notes
Finding Original Status
Different defensible analysis pipelines applied to the same brain-imaging data can reach different conclusions about the same hypotheses. Carp 2012 replicated
A set of brain regions, including medial prefrontal and posterior cingulate cortex, is more active at rest than during many externally directed tasks, and its activity is correlated at rest. Raichle and colleagues 2001 replicated
Correlations between individual differences in brain structure or function and complex behaviour, found in samples of a few dozen people, are large and reproducible. Kanai and Rees 2011 failed
Cluster-extent inference with a lenient cluster-forming threshold (p < 0.01), using the standard parametric approximations, controls the familywise error at the stated 5%. Friston and colleagues 1994 failed
The category of a seen object can be decoded from distributed patterns of activity in ventral temporal cortex, even with the most selective regions left out. Haxby and colleagues 2001 replicated

Shown without a row, with the reason recorded in explainer/psychology/ledger.py: Poldrack, Mumford and Nichols; Power and colleagues; Murphy and colleagues; Naselaris and colleagues; Huth and colleagues; Georgopoulos and colleagues; Willett and colleagues; Jonas and Kording; Elliott and colleagues; Luck.

Notes

The web-search budget for this session was spent on earlier parts, so the facts in this part come from the standard literature and were not re-checked online today; each is listed here to be checked against its source: the seventy teams, nine hypotheses and the size and task of the NARPS sample (Botvinik-Nezer et al. 2020); Carp's count of 6,912 pipelines; Silberzahn et al.'s twenty-nine teams; Raichle et al. (2001) and Greicius et al. (2003); Yeo et al.'s 1,000 people; Kanai and Rees (2011); Boekel et al.'s seventeen correlations and their outcome; Marek et al.'s sample sizes and conclusions; Friston et al. (1994); Woo, Krishnan and Wager (2014); Eklund, Nichols and Knutsson's familywise rates; Haxby et al.'s eight categories (2001) and hyperalignment (2011); Kriegeskorte et al. (2008); Naselaris et al. (2011); Huth et al. (2016) and their number of participants; Power et al. (2012); Murphy et al. (2009); Georgopoulos et al. (1982); Wolpaw's formula; Willett et al. (2023) and other speech neuroprostheses; Elliott et al.'s mean reliability of about 0.4; Jonas and Kording (2017) and its three games; Nichols and Holmes (2002); and every page range in Sources.

Companion material in this repository

The syllabus's plan for this partfrom SYLLABUS.md, the plan of record
  1. Hook: the seventy teams (NARPS). On you: count the forks in a standard pipeline.
  2. Preprocessing: motion, slice timing, registration, smoothing. Head motion as a confound that created findings.
  3. The mass-univariate model at depth: first and second levels; random effects; contrasts.
  4. Thresholds at depth: Gaussian random fields, cluster-extent inference and its failure, permutation tests, FDR (link to Statistics, Built Part 33).
  5. Patterns: multivariate decoding (Haxby et al. 2001); cross-validation and the ways to leak; what decodability does and does not show.
  6. Geometry: representational similarity analysis; comparing a brain region, a model and behaviour through their distance matrices (Part 22's psychological space, in neurons).
  7. Encoding models: predict voxels from features of the stimulus; noise ceilings; semantic maps of cortex.
  8. Connectivity: resting-state networks and the default mode; graph measures; what correlation between regions can mean.
  9. EEG and MEG analysis: ERPs at depth, time–frequency, source estimation; "double dipping" in time windows.
  10. Populations of neurons: the population vector, dimensionality reduction, neural manifolds and dynamics.
  11. Reading out: brain–computer interfaces from cursor control to speech decoding (verify); what they decode (motor intention) and what they do not (thoughts at large).
  12. The sample-size reckoning: brain-wide association studies need thousands; task-fMRI reliability; and the parable of the microprocessor analysed with neuroscience's methods (Jonas and Kording 2017).

Psyche: psyche.neurodata: a synthetic brain with planted effects; the pipeline with switchable choices (a multiverse of several hundred paths); decoding with and without leakage; RSA and encoding models against a known representation; a brain–behaviour correlation's sampling variability at n = 25 and n = 2,500. On you: the fork count. Ledger: analytic variability changing conclusions (replicated); the default-mode network (replicated); small-sample brain–behaviour correlations (failed at scale); cluster inference at lenient thresholds (failed); category decoding from ventral cortex (replicated). In practice: clinical imaging pipelines, BCI engineering, neurotechnology claims and how to audit them. Frontier: foundation models of brain activity; naturalistic stimuli; individual-specific mapping with hours of data per person. Reading: Botvinik-Nezer et al. 2020; Poldrack, Mumford & Nichols 2011; Haxby et al. 2001; Kriegeskorte, Mur & Bandettini 2008; Naselaris et al. 2011; Huth et al. 2016; Marek et al. 2022; Elliott et al. 2020; Jonas & Kording 2017; Luck 2014.

Build the film

python -m videos.psychology.psych49.compute        # the part's numbers, into .cache/psych49
python tools/build.py psych49                  # render and assemble the film
EXPLAINER_TTS=silent python tools/qa_scene.py psych49 Hook   # one chapter, silent, with a contact sheet

Scenes: videos/psychology/psych49. Setup: see the course page. Source of these notes: the README and the scenes' narration.

Build it
python -m videos.psychology.psych49.compute            # every number (about a minute)
python tools/qa_scene.py psych49 Thresholds            # one chapter, silent, at 480p, with a contact sheet
EXPLAINER_TTS=silent python tools/build.py psych49 -q l   # the whole part, silent preview
python tools/build.py psych49                          # 1080p30 with narration
python tools/qa_scene.py psych49 Decoding --lang zh    # the Chinese edition of one chapter
python tools/make.py psych49                           # both editions, with the checks a long build needs
python -m videos.psychology.labs 49                    # the lab: fixed effects, leaks, windows, sample sizes
python tools/check_ledger.py psych49                   # every study shown has its Ledger row, or a reason
python -m pytest tests/psychology                      # Psyche's neurodata module, the Ledger, the Archive

The Chinese edition is zh_lines.py (the narration, line by line) and the series table videos/psychology/psychology_text_zh.json (the text on screen); the terms are in PSYCHOLOGY_ZH_GUIDE.md.