TL;DR
Standard randomization tests break when an experiment’s stimuli depend on a subject’s previous actions—a common scenario in modern "closed-loop" neuroscience. This paper introduces conditional randomization, a method that allows for exact hypothesis testing in these complex time series by resampling stimuli while conditioning on the entire history of responses and rewards.
What Problem Does This Paper Address?
In a "gold standard" randomized experiment, we assume that the experimental variables (like stimuli) are independent of the subject's behavior. To test if a stimulus actually caused a response, we usually shuffle the stimulus sequence to see if the correlation disappears.
However, many behavioral and neural experiments are interactive. For example, a computer might only show a visual cue after a mouse has stopped moving for a certain amount of time. In these cases, the stimulus sequence is inextricably linked to the subject's behavior. If you simply shuffle the stimuli, you create "impossible" data—sequences that could never have happened given the rules of the experiment. This leads to "nonsense correlations" and false positives, making it impossible to tell if the subject is actually responding to the stimulus or just following a internal rhythm that happens to align with the experimental rules.
Methods
The authors propose using conditional randomization to generate a valid "null ensemble" (a collection of fake data that represents what would happen if the stimulus had no effect).
- Conditioning Statistic: Instead of shuffling everything, you identify a subset of data—like the subject’s choices and rewards—to hold constant.
- The Markov Boundary: Using Bayesian networks, the authors show how to identify the "Markov boundary" of a stimulus. This is the set of variables (parents, children, and children’s other parents in a causal graph) that, when held fixed, make the stimulus independent of everything else under the null hypothesis.
- Resampling: You then regenerate the stimulus sequence by sampling from its original probability distribution, but truncated to a "feasible range" that remains consistent with the observed behavior and the experiment's rules.
- Comparison with Tangent Randomization: The paper contrasts this with "tangent randomization," which only conditions on the past. The authors demonstrate that conditioning on the future state of the experiment is often necessary to maintain the validity of the test.
Datasets
The paper validates the method using two simulated behavioral tasks:
- Reaction Time Task: A simulation where a stimulus appears only after a "quiescence interval" (a period of no button pressing). The subject is simulated using three strategies: random pressing, responding to stimuli, and a "deceleration" strategy that mimics learning without actually seeing the stimulus.
- Probabilistic Choice Task: A simulation based on the International Brain Laboratory (IBL) protocols. An agent (modeled as a "mixture of agents" including reinforcement learning and habit) chooses left or right based on noisy stimuli and block-based probabilities.
Key Insights and Ideas
- Exactness is Key: Unlike many statistical tests that rely on large sample sizes to be "approximately" correct, conditional randomization is exact. The probability of a false positive is guaranteed to equal your significance level ($\alpha$), even with very small datasets.
- The Future Matters: A counter-intuitive insight is that to test a hypothesis about the past, you must often condition on the future. Because the experimental apparatus reacts to the subject, the future state of the experiment contains information about the "feasibility" of past stimuli.
- Bayesian Networks as a Map: The paper demonstrates that Bayesian networks aren't just for modeling data; they are essential tools for designing valid statistical tests. They provide a formal recipe for what variables must be controlled during resampling.
Key Results
- Avoiding False Positives: In the reaction time task, the "deceleration strategy" produced data that looked like the subject was responding to stimuli. A standard test might have been fooled, but the conditional randomization test correctly failed to reject the null hypothesis.
- Tangent Randomization Fails: In the choice task, the authors used a test statistic that looked at the correlation between a stimulus and the next trial's choice. Tangent randomization (looking only at the past) failed significantly, rejecting a valid null hypothesis 30% of the time (at a 5% significance level). Conditional randomization maintained the correct 5% rate.
- Power to Detect: When the simulated agent was actually responding to stimuli, the conditional randomization test rejected the null hypothesis in 94.8% of simulations, proving it is a sensitive tool for discovery.
Limitations and Future Work
- Deterministic Traps: Conditional randomization cannot be used if the experiment is entirely deterministic. For example, if a reward is always given for a correct choice ($\beta=1, \gamma=0$), the "feasible range" for the stimulus collapses to a single point. You can't resample the data because there is only one possible stimulus sequence that fits the observations.
- Analytic Difficulty: Deriving the conditional distribution (the "feasible range") can be mathematically challenging for complex experimental designs.
- Design A Priori: The authors emphasize that researchers should design their experiments with these tests in mind. Adding a small amount of randomness to "deterministic" rules (like making a reward 90% likely instead of 100%) can suddenly make an experiment "testable" using these methods.
Summary updated