We assume we observe the fluorescence signal for
T timesteps, and denote by
st the number of spikes that the neuron fired at the
t-th timestep,
t = 1, …,
T, cf.
Fig 1. Following [5 (
link), 13 (
link)], we approximate the calcium concentration dynamics
c using a stable autoregressive process of order
p (AR(
p)) where
p is a small positive integer, usually
p = 1 or 2,
The observed fluorescence
is related to the calcium concentration as [5 (
link)–7 ]:
where
a is a non-negative scalar,
b is a scalar offset parameter, and the noise is assumed to be i.i.d. zero mean Gaussian with variance
σ2. For the remainder we assume units such that
a = 1 without loss of generality. We begin by assuming
b = 0 for simplicity, but we will relax this assumption later. (We also assume throughout that all parameters in sight are fixed; in case of e.g. drifting baselines
b we could generalize the algorithms discussed here to operate over shorter temporal windows, but we do not pursue this here.) The parameters
γi and
σ can be estimated from the autocovariance function and the power spectral density (PSD) of
y respectively [13 (
link)]. The autocovariance approach assumes that the spiking signal
s comes from a homogeneous Poisson process and in practice often gives a crude estimate of
γi. We will improve on this below by fitting the AR coefficients directly, which leads to better estimates, particularly when the spikes have some significant autocorrelation.
The goal of calcium deconvolution is to extract an estimate
of the neural activity
s from the vector of observations
y. As discussed in [5 (
link), 13 (
link)], this leads to the following non-negative LASSO problem for estimating the calcium concentration:
where the
ℓ1 penalty on
enforces sparsity of the neural activity and the lower triangular matrix
G is defined as:
The deconvolution matrix
G is banded with bandwidth
p for an AR(
p) process. Equivalently,
s =
c *
g with
g a finite impulse response filter of order
p (
p + 1 filter taps) and * denoting convolution. To produce calcium trace
c, spike train
s is filtered with the inverse filter of
g, an infinite impulse response
h,
c =
s *
h. (Although our main focus is on the autoregressive model, we will discuss more general convolutional observation models below as well, and touch on nonlinear effects such as saturation in the Appendix.) Following the approach in [5 (
link)], note that the spike signal
is relaxed from non-negative integers to arbitrary non-negative values.