Causal Inference in the Closed-Loop: Marginal Structural Models for Sequential Excursion Effects

Alexander Levis, Gabriel Loewinger, Francisco Pereira
2/3/2026

No confident code implementation found for this paper. 1 possible match can be shown below.

Abstract

Optogenetics is widely used to study the effects of neural circuit manipulation on behavior. However, the paucity of causal inference methodological work on this topic has resulted in analysis conventions that discard information, and constrain the scientific questions that can be posed. To fill this gap, we introduce a nonparametric causal inference framework for analyzing "closed-loop" designs, which use dynamic policies that assign treatment based on covariates. In this setting, standard methods can introduce bias and occlude causal effects. Building on the sequentially randomized experiments literature in causal inference, our approach extends history-restricted marginal structural models for dynamic regimes. In practice, our framework can identify a wide range of causal effects of optogenetics on trial-by-trial behavior, such as, fast/slow-acting, dose-response, additive/antagonistic, and floor/ceiling. Importantly, it does so without requiring negative controls, and can estimate how causal effect magnitudes evolve across time points. From another view, our work extends "excursion effect" methods--popular in the mobile health literature--to enable estimation of causal contrasts for treatment sequences greater than length one, in the presence of positivity violations. We derive rigorous statistical guarantees, enabling hypothesis testing of these causal effects. We demonstrate our approach on data from a recent study of dopaminergic activity on learning, and show how our method reveals relevant effects obscured in standard analyses.

DOISemantic Scholar

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. 1 weaker match is hidden by default — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{levis2026causal,
  title  = {Causal Inference in the Closed-Loop: Marginal Structural Models for Sequential Excursion Effects},
  author = {Alexander Levis and Gabriel Loewinger and Francisco Pereira},
  year   = {2026},
  doi    = {10.52202/079017-3464},
  url    = {https://doi.org/10.52202/079017-3464},
  journal = {NEURIPS 2024 2024}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/5ac182afe3be0f807ce3771d3e5d520f3d019309.svg)](https://codeofpaper.com/paper/5ac182afe3be0f807ce3771d3e5d520f3d019309)

Discussion