State-Space Methods for Inferring Spike Trains from Calcium Imaging

Similar documents
STA 4273H: Statistical Machine Learning

Sean Escola. Center for Theoretical Neuroscience

STA 414/2104: Machine Learning

Machine Learning for OR & FE

Introduction to Machine Learning

Hidden Markov Models. Aarti Singh Slides courtesy: Eric Xing. Machine Learning / Nov 8, 2010

Computer Intensive Methods in Mathematical Statistics

Hidden Markov Models. By Parisa Abedi. Slides courtesy: Eric Xing

A new look at state-space models for neural data

PATTERN RECOGNITION AND MACHINE LEARNING CHAPTER 13: SEQUENTIAL DATA

CPSC 540: Machine Learning

Introduction to Machine Learning CMU-10701

The Kalman Filter ImPr Talk

Bayesian Methods for Machine Learning

Sequential Monte Carlo Methods for Bayesian Computation

Hidden Markov Models Part 2: Algorithms

Computer Intensive Methods in Mathematical Statistics

ECO 513 Fall 2008 C.Sims KALMAN FILTER. s t = As t 1 + ε t Measurement equation : y t = Hs t + ν t. u t = r t. u 0 0 t 1 + y t = [ H I ] u t.

Why do we care? Measurements. Handling uncertainty over time: predicting, estimating, recognizing, learning. Dealing with time

Linear Dynamical Systems

An introduction to Sequential Monte Carlo

Lecture 2: From Linear Regression to Kalman Filter and Beyond

Sequential Monte Carlo and Particle Filtering. Frank Wood Gatsby, November 2007

Pattern Recognition and Machine Learning

Sequence labeling. Taking collective a set of interrelated instances x 1,, x T and jointly labeling them

STA414/2104 Statistical Methods for Machine Learning II

Why do we care? Examples. Bayes Rule. What room am I in? Handling uncertainty over time: predicting, estimating, recognizing, learning

STA 4273H: Statistical Machine Learning

Auxiliary Particle Methods

Probabilistic Graphical Models

CPSC 540: Machine Learning

An Brief Overview of Particle Filtering

STA 4273H: Sta-s-cal Machine Learning

Part 1: Expectation Propagation

Maximum Likelihood (ML), Expectation Maximization (EM) Pieter Abbeel UC Berkeley EECS

State Space and Hidden Markov Models

STA414/2104. Lecture 11: Gaussian Processes. Department of Statistics

Kalman filtering and friends: Inference in time series models. Herke van Hoof slides mostly by Michael Rubinstein

Machine Learning & Data Mining Caltech CS/CNS/EE 155 Hidden Markov Models Last Updated: Feb 7th, 2017

Parametric Inference Maximum Likelihood Inference Exponential Families Expectation Maximization (EM) Bayesian Inference Statistical Decison Theory

Lecture: Gaussian Process Regression. STAT 6474 Instructor: Hongxiao Zhu

Introduction to Machine Learning Midterm, Tues April 8

Answers and expectations

Learning Energy-Based Models of High-Dimensional Data

Advanced Computational Methods in Statistics: Lecture 5 Sequential Monte Carlo/Particle Filtering

+ + ( + ) = Linear recurrent networks. Simpler, much more amenable to analytic treatment E.g. by choosing

Note Set 5: Hidden Markov Models

Math 350: An exploration of HMMs through doodles.

Unsupervised Learning

Approximate Inference

GWAS V: Gaussian processes

Particle Filters. Pieter Abbeel UC Berkeley EECS. Many slides adapted from Thrun, Burgard and Fox, Probabilistic Robotics

Particle Filters. Outline

The 1d Kalman Filter. 1 Understanding the forward model. Richard Turner

Approximate inference in Energy-Based Models

Sequential Monte Carlo Methods (for DSGE Models)

Introduction to Machine Learning CMU-10701

AUTOMOTIVE ENVIRONMENT SENSORS

Pattern Recognition and Machine Learning. Bishop Chapter 11: Sampling Methods

(5) Multi-parameter models - Gibbs sampling. ST440/540: Applied Bayesian Analysis

Online appendix to On the stability of the excess sensitivity of aggregate consumption growth in the US

Lecture 2: From Linear Regression to Kalman Filter and Beyond

STA 4273H: Statistical Machine Learning

Bayesian Calibration of Simulators with Structured Discretization Uncertainty

Approximate Bayesian Computation and Particle Filters

Announcements. CS 188: Artificial Intelligence Fall VPI Example. VPI Properties. Reasoning over Time. Markov Models. Lecture 19: HMMs 11/4/2008

Pattern Recognition and Machine Learning. Bishop Chapter 2: Probability Distributions

Exercises Tutorial at ICASSP 2016 Learning Nonlinear Dynamical Models Using Particle Filters

Variational Autoencoder

Nonparametric Bayesian Methods (Gaussian Processes)

The Particle Filter. PD Dr. Rudolph Triebel Computer Vision Group. Machine Learning for Computer Vision

Lecture 6: Bayesian Inference in SDE Models

Linear Dynamical Systems (Kalman filter)

STA 4273H: Statistical Machine Learning

L11: Pattern recognition principles

ECE276A: Sensing & Estimation in Robotics Lecture 10: Gaussian Mixture and Particle Filtering

Generative Clustering, Topic Modeling, & Bayesian Inference

Computational statistics

Gaussian Process Optimization with Mutual Information

Reading: Karlin and Taylor Ch. 5 Resnick Ch. 3. A renewal process is a generalization of the Poisson point process.

Towards inference for skewed alpha stable Levy processes

Gaussian Process Approximations of Stochastic Differential Equations

Human Pose Tracking I: Basics. David Fleet University of Toronto

Bayesian Computations for DSGE Models

Based on slides by Richard Zemel

Graphical Models for Collaborative Filtering

Markov Models. CS 188: Artificial Intelligence Fall Example. Mini-Forward Algorithm. Stationary Distributions.

13: Variational inference II

A Gentle Tutorial of the EM Algorithm and its Application to Parameter Estimation for Gaussian Mixture and Hidden Markov Models

Bayesian Hidden Markov Models and Extensions

University of Cambridge. MPhil in Computer Speech Text & Internet Technology. Module: Speech Processing II. Lecture 2: Hidden Markov Models I

Doing Bayesian Integrals

Monte Carlo Methods. Geoff Gordon February 9, 2006

Particle Filtering for Data-Driven Simulation and Optimization

Statistical Data Analysis Stat 3: p-values, parameter estimation

Lecture 3. G. Cowan. Lecture 3 page 1. Lectures on Statistical Data Analysis

Computer Intensive Methods in Mathematical Statistics

Infering the Number of State Clusters in Hidden Markov Model and its Extension

PROBABILISTIC REASONING OVER TIME

A new look at state-space models for neural data

Transcription:

State-Space Methods for Inferring Spike Trains from Calcium Imaging Joshua Vogelstein Johns Hopkins April 23, 2009 Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 1 / 78

Outline Introduction 1 Introduction 2 General Methods Generative Model Inverting the model 3 Simplifying our model How to simplify Approximations to our model Gaussian approximation 4 Fast non-negative spike inference (FANSI) Main idea Algorithmic details Discussion 5 Particle-filter-smoother (PFS) spike inference The forward recursion The backward recursion PFS algorithm for our model 6 PFS results Joshua Vogelstein Main result (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 2 / 78

What is our goal? Introduction Inferring spike trains using only calcium imaging Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 3 / 78

Introduction Why is this a hard problem? Many reasons... 1 Too many spike trains to search through them all 2 Noise is non-gaussian 3 Observation are non-linear 4 Parameters are unknown Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 4 / 78

Introduction What are we going to do? Our strategy Write down a generative model, explaining the causal relationship between spikes and movies Develop an algorithm to invert that model, to obtain spike trains and microcircuits from the movies Test our approach on real data Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 5 / 78

Outline General Methods 1 Introduction 2 General Methods 3 Simplifying our model 4 Fast non-negative spike inference (FANSI) 5 Particle-filter-smoother (PFS) spike inference 6 PFS results 7 Concluding thoughts Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 6 / 78

General Methods Generative Model Generative Model is a state-space model Our generative model Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 7 / 78

General Methods Generative Model Generative Model is a state-space model Our generative model n t Poisson(λ ) Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 7 / 78

General Methods Generative Model Generative Model is a state-space model Our generative model n t Poisson(λ ) τ C t C t 1 = C t 1 + n t Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 7 / 78

General Methods Generative Model Generative Model is a state-space model Our generative model τ C t C t 1 n t Poisson(λ ) = C t 1 + n t Y x,t = α x [C t + β] + σ Y ε x,t, ε x,t iid N (0, 1) Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 7 / 78

General Methods Generative Model Generative Model is a state-space model Our generative model τ C t C t 1 n t Poisson(λ ) = C t 1 + n t General state-space formalism Y x,t = α x [C t + β] + σ Y ε x,t, ε x,t iid N (0, 1) C t = γc t 1 + n t, Y t = αc t + ɛ t, n t Possion(λ ) ( ɛ t N αβ, σy 2 ) I Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 7 / 78

General Methods Generative Model Generative Model is a state-space model General state-space formalism C t = γc t 1 + n t, Y t = αc t + ɛ t, n t Possion(λ ) ( ɛ t N αβ, σy 2 ) I State-space distributions Transition distribution: P θ (C t C t 1 ) is Linear-Poisson Observation distribution: P θ ( Y t C t ) is Linear-Gaussian Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 7 / 78

General Methods Generative Model Generative Model for a single neuron Some Notation n = {n t } T t=0 is the spike train ε N (µ, Σ) means ε is distributed according to a Gaussian with mean µ and covariance Σ Y t = {Y x,t } P x=0 is the t-th image frame Y = { Y t } T t=1 is the entire movie θ = {λ, τ, σ c, α, β, σ Y } is the set of model parameters Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 8 / 78

General Methods Generative Model Generative Model for a single neuron Simulation Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 9 / 78

General Methods Generative Model Generative Model for a single neuron Schematic Spatially Filtered Fluorescence Calcium Spike Train 3 6 9 Time (sec) Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 10 / 78

Inverting the model General Methods Inverting the model What does this even mean? Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 11 / 78

Inverting the model General Methods Inverting the model What does this even mean? The model defines: Likelihood: P θ ( Y n) = N ( Y; µ, Σ) Prior: P θ (n) = Poisson(λ ) Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 11 / 78

Inverting the model General Methods Inverting the model What does this even mean? The model defines: Likelihood: P θ ( Y n) = N ( Y; µ, Σ) Prior: P θ (n) = Poisson(λ ) We want the posterior: P θ (n Y) Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 11 / 78

Inverting the model General Methods Inverting the model What does this even mean? The model defines: Likelihood: P θ ( Y n) = N ( Y; µ, Σ) Prior: P θ (n) = Poisson(λ ) We want the posterior: P θ (n Y) We know Bayes Rule: P θ (n Y) P θ ( Y n)p θ (n) Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 11 / 78

Inverting the model General Methods Inverting the model What does this even mean? The model defines: Likelihood: P θ ( Y n) = N ( Y; µ, Σ) Prior: P θ (n) = Poisson(λ ) We want the posterior: P θ (n Y) We know Bayes Rule: P θ (n Y) P θ ( Y n)p θ (n) So, that should be no problem, right? Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 11 / 78

Inverting the model General Methods Inverting the model Problems Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 12 / 78

Inverting the model General Methods Inverting the model Problems Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 12 / 78

Inverting the model General Methods Inverting the model Problems We can compute P θ (n Y) for any individual n, but we may want a point estimate of this distribution Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 12 / 78

Inverting the model General Methods Inverting the model Problems We can compute P θ (n Y) for any individual n, but we may want a point estimate of this distribution For instance, a desirable quantity might be n MAP = argmax n P θ (n Y) Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 12 / 78

Inverting the model General Methods Inverting the model Problems We can compute P θ (n Y) for any individual n, but we may want a point estimate of this distribution For instance, a desirable quantity might be n MAP = argmax n P θ (n Y) Another point estimate of interest may be n mean = E[n Y] Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 12 / 78

Inverting the model General Methods Inverting the model Problems We can compute P θ (n Y) for any individual n, but we may want a point estimate of this distribution For instance, a desirable quantity might be n MAP = argmax n P θ (n Y) Another point estimate of interest may be n mean = E[n Y] Both of these point estimates require having all possible spike trains Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 12 / 78

Inverting the model General Methods Inverting the model Problems We can compute P θ (n Y) for any individual n, but we may want a point estimate of this distribution For instance, a desirable quantity might be n MAP = argmax n P θ (n Y) Another point estimate of interest may be n mean = E[n Y] Both of these point estimates require having all possible spike trains Because n Poisson(λ ): there are an infinite number of possible spike trains we lack the calculus to integrate over Poisson Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 12 / 78

General Methods What to do? Approximate! Inverting the model Two general options Simplify the assumptions to get something tractable Monte Carlo sample from the model, to approximate the distributions Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 13 / 78

Outline Simplifying our model 1 Introduction 2 General Methods 3 Simplifying our model 4 Fast non-negative spike inference (FANSI) 5 Particle-filter-smoother (PFS) spike inference 6 PFS results 7 Concluding thoughts Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 14 / 78

How can we simplify? Simplifying our model How to simplify Simplification steps 1 Explicitly state the all assumptions of our model 2 Determine which ones are giving us trouble 3 Try approximating them Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 15 / 78

Simplifying our model How can we simplify our model? How to simplify Stating our assumptions Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 16 / 78

Simplifying our model How can we simplify our model? How to simplify Stating our assumptions Spikes are Poisson Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 16 / 78

Simplifying our model How can we simplify our model? How to simplify Stating our assumptions Spikes are Poisson Calcium jumps instantaneously after each spike Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 16 / 78

Simplifying our model How can we simplify our model? How to simplify Stating our assumptions Spikes are Poisson Calcium jumps instantaneously after each spike Calcium decays mono-exponentially Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 16 / 78

Simplifying our model How can we simplify our model? How to simplify Stating our assumptions Spikes are Poisson Calcium jumps instantaneously after each spike Calcium decays mono-exponentially Calcium jumps the same size with each spike Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 16 / 78

Simplifying our model How can we simplify our model? How to simplify Stating our assumptions Spikes are Poisson Calcium jumps instantaneously after each spike Calcium decays mono-exponentially Calcium jumps the same size with each spike There are no other sources of fluctuations in calcium Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 16 / 78

Simplifying our model How can we simplify our model? How to simplify Stating our assumptions Spikes are Poisson Calcium jumps instantaneously after each spike Calcium decays mono-exponentially Calcium jumps the same size with each spike There are no other sources of fluctuations in calcium Observations are a linear-gaussian function of calcium Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 16 / 78

Simplifying our model How can we simplify our model? How to simplify Stating our assumptions Spikes are Poisson Calcium jumps instantaneously after each spike Calcium decays mono-exponentially Calcium jumps the same size with each spike There are no other sources of fluctuations in calcium Observations are a linear-gaussian function of calcium Which of these assumptions screws us? Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 16 / 78

Simplifying our model How can we simplify our model? How to simplify Stating our assumptions Spikes are Poisson Calcium jumps instantaneously after each spike Calcium decays mono-exponentially Calcium jumps the same size with each spike There are no other sources of fluctuations in calcium Observations are a linear-gaussian function of calcium Which of these assumptions screws us? Poisson spikes! Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 16 / 78

Simplifying our model How to simplify How can we approximate Poisson spikes? Some reasonable options Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 17 / 78

Simplifying our model How to simplify How can we approximate Poisson spikes? Some reasonable options 1 As 0, Poisson Bernoulli Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 17 / 78

Simplifying our model How to simplify How can we approximate Poisson spikes? Some reasonable options 1 As 0, Poisson Bernoulli 2 When Poisson rate is low, Poisson Exponential Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 17 / 78

Simplifying our model How to simplify How can we approximate Poisson spikes? Some reasonable options 1 As 0, Poisson Bernoulli 2 When Poisson rate is low, Poisson Exponential 3 When Poisson rate is high, Poisson Gaussian Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 17 / 78

Simplifying our model How to simplify How can we approximate Poisson spikes? Some reasonable options 1 As 0, Poisson Bernoulli 2 When Poisson rate is low, Poisson Exponential 3 When Poisson rate is high, Poisson Gaussian Slow rate Poisson Fast rate Poisson poisson exponential gaussian Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 17 / 78

Simplifying our model Approximations to our model A closer look at the problem at hand Rigorously stating the problem to solve n MAP = argmax n P θ (n Y) = argmax P θ ( Y n)p θ (n) n Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 18 / 78

Simplifying our model Approximations to our model A closer look at the problem at hand Rigorously stating the problem to solve n MAP = argmax n = argmax n t t P θ (n Y) = argmax P θ ( Y n)p θ (n) n T t=1 P θ (Y t n t )P θ (n t ) Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 18 / 78

Simplifying our model Approximations to our model A closer look at the problem at hand Rigorously stating the problem to solve n MAP = argmax n = argmax n t t = argmax n t t P θ (n Y) = argmax P θ ( Y n)p θ (n) n T t=1 P θ (Y t n t )P θ (n t ) T log P θ (Y t C t ) + log P θ (n t ) t=1 Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 18 / 78

Simplifying our model Approximations to our model A closer look at the problem at hand Rigorously stating the problem to solve n MAP = argmax n = argmax n t t = argmax n t t = argmax n t t P θ (n Y) = argmax P θ ( Y n)p θ (n) n T t=1 P θ (Y t n t )P θ (n t ) T log P θ (Y t C t ) + log P θ (n t ) t=1 T log N ( Y t αc t 1β, σy 2 I) + log P θ (n t ) t=1 Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 18 / 78

Simplifying our model Approximations to our model A closer look at the problem at hand Rigorously stating the problem to solve n MAP = argmax n = argmax n t t = argmax n t t = argmax n t t = argmax n t t P θ (n Y) = argmax P θ ( Y n)p θ (n) n T t=1 P θ (Y t n t )P θ (n t ) T log P θ (Y t C t ) + log P θ (n t ) t=1 T log N ( Y t αc t 1β, σy 2 I) + log P θ (n t ) t=1 T 1 2σ 2 t=1 Y Y t αc t 1β 2 + log P θ (n t ) Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 18 / 78

Simplifying our model Approximations to our model Writing the prior in terms of C t Rewriting the calcium dynamics τ C t C t 1 = C t 1 + n t 1 C t = γc t 1 + n t 1 n t 1 = (C t γc t 1 ) n = MC Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 19 / 78

Simplifying our model Approximations to our model Writing the prior in terms of C t Rewriting the calcium dynamics τ C t C t 1 = C t 1 + n t 1 C t = γc t 1 + n t 1 n t 1 = (C t γc t 1 ) n = MC Rewriting the optimization in terms of C t C MAP = argmax C t t T 1 2σ 2 t=1 Y Y t αc t 1β 2 + log P θ (C t γc t 1 ) Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 19 / 78

Simplifying our model Gaussian approximation A closer look at the Gaussian approximation Gaussian approximation of P θ (n) C MAP = argmax C t t argmax C t t = argmax C t t T 1 2σ 2 t=1 Y T 1 2σ 2 t=1 Y T 1 2σ 2 t=1 Y Y t αc t 1β Y t αc t 1β Y t αc t 1β 2 + log P θ (n t ) 2 + log N (n t ; λ, λ ) 2 + 1 2(λ ) 2 (C t γc t 1 λ ) 2 Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 20 / 78

Simplifying our model Gaussian approximation A closer look at the Gaussian approximation Gaussian approximation of P θ (n) C MAP = argmax C t t T 1 2σ 2 t=1 Y Y t αc t 1β Thoughts on the Gaussian approximation We have a quadratic problem It is, in fact, a Wiener filter We can solve this in O(T ) 2 + Spikes are not constrained to be non-negative Spikes are not constrained to be integers 1 2(λ ) 2 (C t γc t 1 λ ) 2 Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 20 / 78

Simplifying our model Gaussian approximation A closer look at the Gaussian approximation Wiener filter for slow and fast firing rate simulated neurons Slow Firing Rate Fast Firing Rate 1 Fluorescence 0 11 0 1 Wiener Filter 0 11 0.4 0.8 1.2 1.6 Time (sec) 0 0.4 0.8 1.2 1.6 Time (sec) Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 21 / 78

Outline Fast non-negative spike inference (FANSI) 1 Introduction 2 General Methods 3 Simplifying our model 4 Fast non-negative spike inference (FANSI) 5 Particle-filter-smoother (PFS) spike inference 6 PFS results 7 Concluding thoughts Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 22 / 78

Fast non-negative spike inference (FANSI) Main idea A closer look at the exponential approximation Exponential approximation of P θ (n) C MAP = argmax C t γc t 1 0 t argmax C t γc t 1 0 t = argmax C t γc t 1 0 t T 1 2σ 2 t=1 Y T 1 2σ 2 t=1 Y T 1 2σ 2 t=1 Y Y t αc t 1β Y t αc t 1β Y t αc t 1β 2 + log P θ (n t ) 2 + log Exp(n t ; λ ) 2 λ (C t γc t 1 ) Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 23 / 78

Fast non-negative spike inference (FANSI) Main idea A closer look at the exponential approximation Exponential approximation of P θ (n) C MAP = argmax C t γc t 1 0 t T 1 2σ 2 t=1 Y Y t αc t 1β Thoughts on the exponential approximation We have a concave (but not quadratic) problem We can solve this in O(T ) Spikes are constrained to be non-negative Spikes are not constrained to be integers 2 λ (C t γc t 1 ) Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 23 / 78

Fast non-negative spike inference (FANSI) Main idea A closer look at the exponential approximation FANSI for slow and fast firing rate simulated neurons Slow Firing Rate Fast Firing Rate Fluorescence 1 Fast Filter 11 0 0.4 0.8 1.2 1.6 Time (sec) 0 0.4 0.8 1.2 1.6 Time (sec) Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 24 / 78

Fast non-negative spike inference (FANSI) Algorithmic details FANSI algorithm for solving non-negative state-space problems Direct method: optimize C MAP directly C MAP = argmax C t γc t 1 0 t = argmax C t γc t 1 0 t T 1 2σ 2 t=1 Y 1 2σ 2 Y Y t αc t 1β Y t αc t 1β Barrier method: optimize C z iteratively C z = argmax C t t 2σ 2 Y 2 λ (C t γc t 1 ) 2 λ (MC) 1 1 Y t αc t 1β 2 λ (MC) 1 + z log(mc) 1 Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 25 / 78

Fast non-negative spike inference (FANSI) Algorithmic details Finding C z It s concave, so we just use Newton-Raphson L z = 1 2σ 2 Y Y t αc t 1β 2 λ (MC) 1 + z log(mc) 1 g = α σy 2 ( Y αc 1β) + λ M 1 zm (MC z ) 1 H = α α σy 2 + zm (MC z ) 2 M C z C z + sd Hd = g d = H\g Some thoughts Because M is bidiagonal, H is tridiagonal This means that we can use Gaussian elimination Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 26 / 78

Fast non-negative spike inference (FANSI) Estimating the parameters Algorithmic details Pseudo-EM EM requires sufficient statistics that we don t compute However, we can estimate θ = argmax P( Y n, θ)p(n θ)dn argmax P( Y n, θ)p( n θ) θ Θ θ Θ We iterate finding n and θ The likelihood for the parameters is concave In practice, we can always find good parameters, without modifying the initial values, with relatively little data Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 27 / 78

Fast non-negative spike inference (FANSI) Using our FANSI filter Algorithmic details in vivo data Fluorescence Projection Fast Filter 6 12 18 24 Time (sec) Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 28 / 78

Fast non-negative spike inference (FANSI) Summary of results so far Discussion Fast non-negative spike inference (FANSI) Due to state-space nature, requires only O(T ) Outperforms Wiener filter for both fast and slow spiking neurons Works for in vivo data Parameter estimation is simple and straightforward (and unsupervised) Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 29 / 78

Fast non-negative spike inference (FANSI) Straightforward generalizations Discussion Relaxing various assumptions, but staying within the state-space framework Time varying rate more flexible prior Slow rise time add another C with different dynamics Poisson observations likelihood maintains concavity (unlike Poisson dynamics) Optimal thresholding initialize an integer programming algorithm with n Multiple neurons even overlapping spatial filters is ok Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 30 / 78

Fast non-negative spike inference (FANSI) Discussion Not straightforward generalizations Desirata not easily incorporated into our FANSI framework Non-Poisson spiking eg, spike history dependence Non-linear observations fluorescence saturates Errorbars FANSI only provides a MAP estimate (which is not conducive to a Laplace approximation) Coupling between neurons an extension of spike history dependence Better parameter estimation requires sufficient stats not available from FANSI Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 31 / 78

Fast non-negative spike inference (FANSI) Discussion So, what can we do, to achieve these desirata? Remember this slide? Simplify the assumptions to get something tractable Monte Carlo sample from the model, to approximate the distributions We already did the simplify option, let s try the Monte Carlo option. Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 32 / 78

Particle-filter-smoother (PFS) spike inference Outline 1 Introduction 2 General Methods 3 Simplifying our model 4 Fast non-negative spike inference (FANSI) 5 Particle-filter-smoother (PFS) spike inference 6 PFS results 7 Concluding thoughts Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 33 / 78

Particle-filter-smoother (PFS) spike inference Remember the state-space formalism? General state-space formalism C t = γc t 1 + n t, Y t = αc t + ɛ t, n t Possion(λ ) ( ɛ t N αβ, σy 2 ) I Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 34 / 78

Particle-filter-smoother (PFS) spike inference Remember the state-space formalism? General state-space formalism C t = γc t 1 + n t, Y t = αc t + ɛ t, n t Possion(λ ) ( ɛ t N αβ, σy 2 ) I So, what does sampling mean here? Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 34 / 78

Particle-filter-smoother (PFS) spike inference Remember the state-space formalism? General state-space formalism C t = γc t 1 + n t, Y t = αc t + ɛ t, n t Possion(λ ) ( ɛ t N αβ, σy 2 ) I So, what does sampling mean here? Sample spike trains! Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 34 / 78

Particle-filter-smoother (PFS) spike inference Remember the state-space formalism? General state-space formalism C t = γc t 1 + n t, Y t = αc t + ɛ t, n t Possion(λ ) ( ɛ t N αβ, σy 2 ) I So, what does sampling mean here? Sample spike trains! How do we do it? Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 34 / 78

Particle-filter-smoother (PFS) spike inference What are some ways we can sample spike trains? Three general approaches Naïve too slow: > 2 T possible spike trains Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 35 / 78

Particle-filter-smoother (PFS) spike inference What are some ways we can sample spike trains? Three general approaches Naïve too slow: > 2 T possible spike trains Markov Chain Monte Carlo (MCMC) too difficult: because space of spike trains is so non-convex Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 35 / 78

Particle-filter-smoother (PFS) spike inference What are some ways we can sample spike trains? Three general approaches Naïve too slow: > 2 T possible spike trains Markov Chain Monte Carlo (MCMC) too difficult: because space of spike trains is so non-convex Sequential Monte Carlo (or particle filter; SMC) just right! Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 35 / 78

Particle-filter-smoother (PFS) spike inference What are some ways we can sample spike trains? Three general approaches Naïve too slow: > 2 T possible spike trains Markov Chain Monte Carlo (MCMC) too difficult: because space of spike trains is so non-convex Sequential Monte Carlo (or particle filter; SMC) just right! What s the big idea? Let s say we have a state-space model and we want to infer some statistics about the hidden state what do we do? Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 35 / 78

Particle-filter-smoother (PFS) spike inference What are some ways we can sample spike trains? Three general approaches Naïve too slow: > 2 T possible spike trains Markov Chain Monte Carlo (MCMC) too difficult: because space of spike trains is so non-convex Sequential Monte Carlo (or particle filter; SMC) just right! What s the big idea? Let s say we have a state-space model and we want to infer some statistics about the hidden state what do we do? forward-backward algorithm Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 35 / 78

Particle-filter-smoother (PFS) spike inference Forward backward algorithms Two familiar special cases Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 36 / 78

Particle-filter-smoother (PFS) spike inference Forward backward algorithms Two familiar special cases Discrete state-space models (HMM) remember the Baum-Welch algorithm? Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 36 / 78

Particle-filter-smoother (PFS) spike inference Forward backward algorithms Two familiar special cases Discrete state-space models (HMM) remember the Baum-Welch algorithm? Linear-Gaussian dynamics remember the Kalman filter-smooth? Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 36 / 78

Particle-filter-smoother (PFS) spike inference Forward backward algorithms how do they work again? Forward recursion First compute the probability of the hidden state, given all previous observations, P θ (H t Y 0:t ) This is called the filter (or forward) distribution Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 37 / 78

Particle-filter-smoother (PFS) spike inference Forward backward algorithms how do they work again? Forward recursion First compute the probability of the hidden state, given all previous observations, P θ (H t Y 0:t ) This is called the filter (or forward) distribution Backward recursion Then compute the probability of the hidden state, given all observations (both past and future), P θ (H t Y 0:T ) This is called the smooth (or backward) distribution Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 37 / 78

Particle-filter-smoother (PFS) spike inference What are these recursions? Forward recursion P θ (H t Y 0:t ) = 1 Z P θ( Y t H t ) P θ (H t H t 1 )P θ (H t 1 Y 0:t 1 )dh t 1 Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 38 / 78

Particle-filter-smoother (PFS) spike inference What are these recursions? Forward recursion P θ (H t Y 0:t ) = 1 Z P θ( Y t H t ) P θ (H t H t 1 )P θ (H t 1 Y 0:t 1 )dh t 1 Backward recursion P θ (H t, H t 1 Y) = P θ (H t Y) P θ (H t H t 1 )P θ (H t 1 Y 0:t 1 ) Pθ (H t H t 1 )P θ (H t 1 Y 0:t 1 )dh t 1 P θ (H t 1 Y) = P θ (H t, H t 1 Y)dH t Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 38 / 78

Particle-filter-smoother (PFS) spike inference The forward recursion A closer look at the forward recursion Consider the integral P θ (H t H t 1 )P θ (H t 1 Y 0:t 1 )dh t 1 Under which circumstances can we analytically evaluate that integral? When H t takes finite possible values (ie, for HMM) Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 39 / 78

Particle-filter-smoother (PFS) spike inference The forward recursion A closer look at the forward recursion Consider the integral P θ (H t H t 1 )P θ (H t 1 Y 0:t 1 )dh t 1 Under which circumstances can we analytically evaluate that integral? When H t takes finite possible values (ie, for HMM) When both distributions are Gaussian, as the product of Gaussians are... Gaussian Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 39 / 78

Particle-filter-smoother (PFS) spike inference The forward recursion A closer look at the forward recursion Consider the integral P θ (H t H t 1 )P θ (H t 1 Y 0:t 1 )dh t 1 What can we do to approximate this integral? Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 40 / 78

Particle-filter-smoother (PFS) spike inference The forward recursion A closer look at the forward recursion Consider the integral P θ (H t H t 1 )P θ (H t 1 Y 0:t 1 )dh t 1 What can we do to approximate this integral? Discretize on a grid Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 40 / 78

Particle-filter-smoother (PFS) spike inference The forward recursion A closer look at the forward recursion Consider the integral P θ (H t H t 1 )P θ (H t 1 Y 0:t 1 )dh t 1 What can we do to approximate this integral? Discretize on a grid Approximation distributions as Gaussians (Laplace approximation) Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 40 / 78

Particle-filter-smoother (PFS) spike inference The forward recursion A closer look at the forward recursion Consider the integral P θ (H t H t 1 )P θ (H t 1 Y 0:t 1 )dh t 1 What can we do to approximate this integral? Discretize on a grid Approximation distributions as Gaussians (Laplace approximation) Sample! Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 40 / 78

Particle-filter-smoother (PFS) spike inference Approximating P θ (H t Y 0:t ) The forward recursion Approximate with a histogram P θ (H t Y 0:t ) N ( ) w (i) t δ H t H (i) t i=1 N particles at each time step w (i) t H (i) t indicates the weight (likelihood) particle i at time t indicates the position of particle i at time t Collectively, they comprise the approximation to our distribution Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 41 / 78

Particle-filter-smoother (PFS) spike inference Approximating P θ (H t Y 0:t ) The forward recursion Approximate with a histogram P θ (H t Y 0:t ) N ( ) w (i) t δ H t H (i) t i=1 Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 41 / 78

Particle-filter-smoother (PFS) spike inference The forward recursion Substituting this approximation into the integral Given samples, what do we do? P θ (H t Y 0:t ) = 1 Z P θ( Y t H t ) P θ (H t H t 1 )P θ (H t 1 Y 0:t 1 )dh t 1 w (i) t w (i) t = = P θ ( Yt H (i) t P θ ( Yt H (i) t N j=1 w (i) t (j) w t ) N ( P θ j=1 ) P θ ( H (i) t H (i) t H (j) t 1 H (i) t 1 ) w (i) t 1 ) w (j) t 1 Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 42 / 78

Particle-filter-smoother (PFS) spike inference The forward recursion But how do we actually get the samples? Importance sampling w (i) t ( ) ( P Yt θ H (i) t P θ ( q H (i) t H (i) t 1 H (i) t ) ) w (i) t 1 q( ) is called the proposal (or importance) distribution (or density) { } q( ) can depend on anything in the past, ie, H (j) N t 1 and Y 0:t j=1 we have various standard options Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 43 / 78

Particle-filter-smoother (PFS) spike inference The forward recursion Typical proposal distribution options Transition distribution sampler ( ) If q( ) = P θ H (i) t H (i) t 1, then the computation of the forward distribution is straightforward: ( ) w (i) t = P Yt θ H (i) t w (i) t 1 Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 44 / 78

Particle-filter-smoother (PFS) spike inference The forward recursion Typical proposal distribution options Transition distribution sampler ( ) If q( ) = P θ H (i) t H (i) t 1, then the computation of the forward distribution is straightforward: ( ) w (i) t = P Yt θ H (i) t w (i) t 1 One step ahead sampler ( q( ) = P θ H (i) t H (i) t 1, Y ) ( t P θ H (i) t H (i) t 1 ) ( ) P Yt θ H (i) t more efficient than the transition distribution, as it also considers observations Computing the forward distribution no longer simplifies It is sometimes difficult to sample from Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 44 / 78

Particle-filter-smoother (PFS) spike inference The forward recursion Typical proposal distribution options One step ahead sampler ( q( ) = P θ H (i) t H (i) t 1, Y ) ( t P θ H (i) t H (i) t 1 ) ( ) P Yt θ H (i) t more efficient than the transition distribution, as it also considers observations Computing the forward distribution no longer simplifies It is sometimes difficult to sample from Optimal sampler q( ) = P θ ( H (i) t H (i) t 1, Y ) ( t:t P θ Uses all available information H (i) t H (i) t 1 ) ( ) P Yt:T θ H (i) t Sometimes (approximately) possible using a backwards recursion Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 44 / 78

Particle-filter-smoother (PFS) spike inference The procedure so far The forward recursion For each time step, for each particle 1 Sample from the proposal distribution 2 Update weights 3 Normalize weights Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 45 / 78

Particle-filter-smoother (PFS) spike inference The procedure so far The forward recursion For each time step, for each particle 1 Sample from the proposal distribution 2 Update weights 3 Normalize weights Anybody see a problem? Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 45 / 78

Particle-filter-smoother (PFS) spike inference The procedure so far The forward recursion For each time step, for each particle 1 Sample from the proposal distribution 2 Update weights 3 Normalize weights Anybody see a problem? Weights degenerate Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 45 / 78

Particle-filter-smoother (PFS) spike inference The procedure so far The forward recursion For each time step, for each particle 1 Sample from the proposal distribution 2 Update weights 3 Normalize weights Anybody see a problem? Weights degenerate Draw an example on the board Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 45 / 78

Particle-filter-smoother (PFS) spike inference Anybody see a solution The forward recursion Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 46 / 78

Particle-filter-smoother (PFS) spike inference Anybody see a solution The forward recursion Resample Sample particles (with replacement) according to their weights If we do it too often, we reduce to our particle diversity If we do it too infrequently, the weights degenerate Thus, it is standard to resample when the effective number of particles is too small: N eff = N ( i=1 w (i) t ) 2 The threshold is typically taken to be N/2 Goal: expectation of resampled distribution should be equal to original distribution Given this constraint, we want to minimize variance Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 46 / 78

Particle-filter-smoother (PFS) spike inference Resampling schemes The forward recursion Multinomial resampling Draw particle i with probability w (i) t This is the simplest strategy, but not the best Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 47 / 78

Particle-filter-smoother (PFS) spike inference Resampling schemes The forward recursion Multinomial resampling Draw particle i with probability w (i) t This is the simplest strategy, but not the best Stratified resampling Discretize (0, 1] into N equal partitions Sample once from each partition Call cumsum on the weights to generate a cumulative sum of weights Each time a sample falls into the interval for a particular particle, keep that particle This approach has a lower conditional variance than multinomial sampling Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 47 / 78

Particle-filter-smoother (PFS) spike inference The forward recursion Putting the whole forward recursion (ie, particle filter) together For each time step, for each particle 1 Sample from the proposal distribution 2 Update weights 3 Normalize weights 4 Stratified resample, if necessary Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 48 / 78

Particle-filter-smoother (PFS) spike inference The forward recursion Putting the whole forward recursion (ie, particle filter) together For each time step, for each particle 1 Sample from the proposal distribution 2 Update weights 3 Normalize weights 4 Stratified resample, if necessary Demo the procedure on the board Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 48 / 78

Particle-filter-smoother (PFS) spike inference Remember the backward recursion The backward recursion Backward recursion P θ (H t, H t 1 Y) = P θ (H t Y) P θ (H t H t 1 )P θ (H t 1 Y 0:t 1 ) Pθ (H t H t 1 )P θ (H t 1 Y 0:t 1 )dh t 1 P θ (H t 1 Y) = P θ (H t, H t 1 Y)dH t Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 49 / 78

Particle-filter-smoother (PFS) spike inference Remember the backward recursion The backward recursion Backward recursion P θ (H t, H t 1 Y) = P θ (H t Y) P θ (H t H t 1 )P θ (H t 1 Y 0:t 1 ) Pθ (H t H t 1 )P θ (H t 1 Y 0:t 1 )dh t 1 P θ (H t 1 Y) = P θ (H t, H t 1 Y)dH t Substituting the results from our forward recursion, obtaining a particle-filter-smoother (PFS) P θ ( H (i) t ) (, H (j) t 1 Y = P θ ( ) P θ H (j) t 1 Y = H (i) t N ( P θ ( Y ) P θ H (i) t H (j) t 1 N j=1 P θ (H (i) t H (j) t 1 ) ( ) P θ H (j) t 1 Y 0:t 1 ) ( ) P θ H (j) t 1 Y 0:t 1 H (i) t, H (j) t 1 Y i=1 Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 49 / 78 )

Particle-filter-smoother (PFS) spike inference Remember the backward recursion The backward recursion Backward recursion P θ (H t, H t 1 Y) = P θ (H t Y) P θ (H t H t 1 )P θ (H t 1 Y 0:t 1 ) Pθ (H t H t 1 )P θ (H t 1 Y 0:t 1 )dh t 1 P θ (H t 1 Y) = P θ (H t, H t 1 Y)dH t Some thoughts on the backwards recursion Plug and chug (ie, does not require computing any new distributions) Scales with O ( N 2 T ) because we need the probability of going from any N particles at time t 1, to any N particles at time t For applications like ours, can really refine our estimates (as most of the information comes from after the spike) Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 49 / 78

Particle-filter-smoother (PFS) spike inference The backward recursion The whole PFS algorithm for non-analytic state-space models For t = 1,..., T, for each particle Sample from the proposal distribution Update weights Normalize weights Stratified resample, if necessary For t = T,..., 1, for each particle Update backward distribution Things to choose Proposal Number of particles Resampling details Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 50 / 78

Particle-filter-smoother (PFS) spike inference PFS algorithm for our model PFS algorithm for our model Our model (slightly modified) n t B(λ ) C t = γc t 1 + An t + σ c ε t, ε t N (0, 1) ( Y t = αc t + ɛ t, ɛ t N αβ, σy 2 ) I The necessary distributions P θ (C t C t 1, n t ) { N (γc t 1 + An t, σ 2 c) if n t = 1 N (γc t 1, σ 2 c) if n t = 0 P θ ( Y t C t ) N (αc t + αβ, σ 2 Y I) Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 51 / 78

Particle-filter-smoother (PFS) spike inference PFS algorithm for our model One step ahead sampler for our model Defining q( ) ( ) q {C, n} (i) t ( ) ( = P Yt θ C (i) t P θ C (i) t {C t 1, n t } (i)) ( P θ n (i) t ) Procedure First sample spikes, by integrating out C t Then, given spikes, sample C t Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 52 / 78

( Sampling from q Particle-filter-smoother (PFS) spike inference n (i) t ) PFS algorithm for our model by integrating out C t Solving the integral ( q n (i) t ) = = P θ ( = P θ ( = P θ ( ( q {C, n} (i) t n (i) t n (i) t n (i) t ) dc (i) t ) ( ) ( P Yt θ C (i) P θ t C (i) t {C t 1, n t } (i)) dc (i) ) ( ) ( N C (i) t ; µ 1, σ1 2 N C (i) t ; µ 2 (n (i) t ), σ2 2 ) ( N Yt ; µ 3 ({C t 1, n t } (i) ), σ3) 2 t ) dc (i) t So, we compute the probability of n (i) t = 0 and 1 by plugging those values into the above equation, and then we sample from that distribution Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 53 / 78

( Sampling from q Particle-filter-smoother (PFS) spike inference C (i) t ) PFS algorithm for our model Solving the integral ( q C (i) t ) = 1 Z P θ = 1 ( Z N = N ( ) ( Yt C (i) t P θ C (i) C (i) t {C t 1, n t } (i)) ( C (i) ) N t ; µ 4 ( Y t ), σ4 2 ( C (i) t, µ 6 ( Y t, {C t 1, n t } (i) ), σ6 2 t ; µ 5 ({C t 1, n t } (i) ), σ5 2 ) ) Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 54 / 78

Particle-filter-smoother (PFS) spike inference Weighting the samples PFS algorithm for our model Plug in the proposal distributions ( ( ) P w (i) t = w (i) t 1 P Yt θ C (i) θ C (i) t q ) ( t {C t 1, n t }(i) P θ ( ) ( ) q n (i) t C (i) t n (i) t ) Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 55 / 78

Particle-filter-smoother (PFS) spike inference PFS algorithm for our model Estimating the parameters in our model The PFS algorithm provides the sufficient statistics for all the parameters Each parameter depends on either P θ (H t Y) or P θ (H t, H t 1 Y), both of which we have from the forward-backward algorithm Parameters are jointly concave, given the inferred hidden distributions In practice, a small number of iterations is required to converge to reasonable answers Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 56 / 78

Particle-filter-smoother (PFS) spike inference PFS algorithm for our model Some thoughts on our PFS algorithm Comparison with FANSI Should be more accurate than FANSI, as the approximation is better Provides errorbars (FANSI doesn t) Parameters can be estimated better than FANSI Requires O(N 2 T ) (FANSI only requires O(T ) Can be further generalized Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 57 / 78

Outline PFS results 1 Introduction 2 General Methods 3 Simplifying our model 4 Fast non-negative spike inference (FANSI) 5 Particle-filter-smoother (PFS) spike inference 6 PFS results 7 Concluding thoughts Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 58 / 78

PFS results Main result Main result using our Particle-Filter-Smoother (PFS) Inferring a spike train from noisy observations Simulated Spike Train Simulated Calcium Simulated Fluorescence Wiener Filter Linear Observation PFS Spike Inference 1 2 3 4 5 6 7 8 9 10 Time (sec) Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 59 / 78

PFS results Nonlinear observations Incorporating nonlinear observations Modifying the model C t = γc t 1 + C b + An t + σ c εt, ε t N (0, 1) Y t = α[s(c t ) + β] + ξs(c t ) + ηɛ t, ɛ t N (0, I) S(C t ) = C n d t C n d t + k d Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 60 / 78

PFS results Nonlinear observations Incorporating nonlinear observations Modifying the model C t = γc t 1 + C b + An t + σ c εt, ε t N (0, 1) Y t = α[s(c t ) + β] + ξs(c t ) + ηɛ t, ɛ t N (0, I) S(C t ) = C n d t C n d t + k d What must change? Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 60 / 78

PFS results Nonlinear observations Incorporating nonlinear observations Modifying the model C t = γc t 1 + C b + An t + σ c εt, ε t N (0, 1) Y t = α[s(c t ) + β] + ξs(c t ) + ηɛ t, ɛ t N (0, I) S(C t ) = C n d t C n d t + k d What must change? Observation distribution, P θ ( Y t C t ) Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 60 / 78

PFS results Nonlinear observations Incorporating nonlinear observations Modifying the model C t = γc t 1 + C b + An t + σ c εt, ε t N (0, 1) Y t = α[s(c t ) + β] + ξs(c t ) + ηɛ t, ɛ t N (0, I) S(C t ) = C n d t C n d t + k d What must change? Observation distribution, P θ ( Y t C t ) Proposal distribution, q( ) Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 60 / 78

PFS results Nonlinear observations How do we modify the relevant distributions Observation distribution P θ ( Y ( t C t ) = N Yt ; µ 7 (S(C t )), σ 7 (S(C t )) 2) We want a Gaussian function of C t We don t have it, but we compute a Laplacian approximation Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 61 / 78

PFS results Nonlinear observations How do we modify the relevant distributions Observation distribution P θ ( Y ( t C t ) = N Yt ; µ 7 (S(C t )), σ 7 (S(C t )) 2) Laplace We want a Gaussian function of C t We don t have it, but we compute a Laplacian approximation Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 61 / 78

Nonlinear observation PFS results Nonlinear observations in silico data Simulated Spike Train Simulated Calcium Simulated Fluorescence Wiener Filter Nonlinear Observation PFS Spike Inference Nonlinear Observation PFS [Ca 2+ ] Inference 1 2 3 4 5 6 7 8 9 10 Time (sec) Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 62 / 78

Nonlinear observation PFS results Nonlinear observations in vitro bursts in vitro Fluorescence Wiener Filter Nonlinear Observation PFS Spike Inference Nonlinear Observation PFS [Ca 2+ ] Inference 1 2 3 4 5 6 7 9 10 Time (sec) Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 63 / 78

Nonlinear observation PFS results Nonlinear observations in vitro spike train in vitro Fluorescence Wiener Filter Nonlinear Observation PFS Spike Inference Nonlinear Observation PFS [Ca 2+ ] Inference 0 1 2 3 4 5 Time (sec) Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 64 / 78

Intermittent observations PFS results Intermittent observations Generalizing the model Y t = α[s(c t ) + β] + ξs(c t ) + ηɛ t, t/d Z Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 65 / 78

Intermittent observations PFS results Intermittent observations Generalizing the model Y t = α[s(c t ) + β] + ξs(c t ) + ηɛ t, t/d Z Generalizing the observation distribution P θ ( Y t C t ) = { N (α[s(c t ) + β], ξs(c t ) + η) if t/d Z 1 otherwise Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 65 / 78

PFS results One observation ahead sampler Intermittent observations Let v be the time step of the next observation ( q H (i) t ) ( ) ( = P Yv θ H (i) t P θ H (i) t H (i) t 1 ) We can start at time v and use the nonlinear observation sampler Then, we can recursively step backward, using the standard backward recursion Note, however, that the number of possible spike trains is 2 v t Thus, if d >> 1, we have a mixture with too many components Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 66 / 78

PFS results Approximating P θ ( Yv H (i) t ) Intermittent observations Reduce from 2 v t to v t + 1 Exact Approximate 0 0 [Ca 2+ ] (A µm) 1 2 3 4 1 2 3 4 v 4 v 2 v Time Step v 4 v 2 v Time Step Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 67 / 78

PFS results Approximating P θ ( Yv H (i) t ) Intermittent observations Reduce from 2 v t to v t + 1 Exact Approximate 0 0 [Ca 2+ ] (A µm) 1 2 3 4 1 2 3 4 v 4 v 2 v Time Step v 4 v 2 v Time Step Plug in our approximate observation distribution and sample ( q H (i) t ) = P ( ) ( Yv θ H (i) t P θ H (i) t H (i) t 1 ) Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 67 / 78

PFS results Intermittent observations One observation ahead sampler improves performance One observation ahead sampler Particles Prior sampler Inferred Distributions Weighted Spike History Spike Train Calcium Concentration u Time (sec) v u Time (sec) v One observation ahead sampler Particles Inferred Distributions Weighted Spike History Spike Train Calcium Concentration u Time (sec) v u Time (sec) v Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 68 / 78

PFS results Intermittent observations Array of results varying noise and intermittency One observation ahead sampler 20 ms Increasing Frame Rate 40 ms 80 ms 160 ms 0.3 0.6 0.9 Time (sec) 2! F 4! F 8! F Increasing Observation Noise Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 69 / 78

PFS results Incorporating stimulus and spike history dependence Incorporating stimulus and spike history dependence Generalizing the model Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 70 / 78

PFS results Incorporating stimulus and spike history dependence Incorporating stimulus and spike history dependence Generalizing the model P θ (n t ) = B ( n t ; f (b + kx t + ωh t ) ) h t = γ h h t 1 + n t 1 + σ h εt, ε t N (0, 1) Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 70 / 78

PFS results Incorporating stimulus and spike history dependence Incorporating stimulus and spike history dependence Generalizing the model P θ (n t ) = B ( n t ; f (b + kx t + ωh t ) ) h t = γ h h t 1 + n t 1 + σ h εt, ε t N (0, 1) Constraints on dynamics Joshua Vogelstein (Johns Hopkins) State-Space Calcium Imaging April 23, 2009 70 / 78