LZeroSpikeInference v1.0.1


Monthly downloads



by Sean Jewell

Exact Spike Train Inference via L0 Optimization

An implementation of algorithms described in Jewell and Witten (2017) <arXiv:1703.08644>.


LZeroSpikeInference: A package for estimating spike times from calcium imaging data using an L0 penalty Build Status

This package implements an algorithm for deconvolving calcium imaging data for a single neuron in order to estimate the times at which the neuron spikes.

This algorithm solves the optimization problems

AR(1) model

minimize{c1,...,cT} 0.5 sum{t=1}^T ( y_t - ct )^2 + lambda sum{t=2}^T 1_{ct neq gamma c{t-1} }

for the global optimum, where y_t is the observed fluorescence at the tth timepoint.

AR(1) with intercept

minimize{c1,...,cT,b1,...,bT} 0.5 sum{t=1}^T (y_t - c_t - bt)^2 + lambda sum{t=2}^T 1_{ct neq gamma c{t-1}, bt neq b{t-1} }

where the indicator variable 1_{(A,B)} equals 1 if the event A cup B holds, and equals zero otherwise.


If devtools is installed type



Once installed type



See Jewell and Witten, Exact Spike Train Inference Via L0 Optimization (2017)

Functions in LZeroSpikeInference

Name Description
plot.estimatedSpikes Plot the solution to an L0 segmentation problem
plot.simdata Plot simulated data
estimateSpikes Estimate spike train, underlying calcium concentration, and changepoints based on fluorescence
plot.cvSpike Plot mean squared error vs. tuning parameter from the cross-validation output
print.cvSpike Print CV results
print.estimatedSpikes Print estimated spikes
LZeroSpikeInference LZeroSpikeInference: LZeroSpikeInference: A package for estimating spike
cv.estimateSpikes Cross-validate and optimize model parameters
print.simdata Print simulated data
simulateAR1 Simulate fluorescence trace based on simple AR(1) generative model
No Results!

Last month downloads


Type Package
License GPL-3
Encoding UTF-8
LazyData true
RoxygenNote 6.0.1
NeedsCompilation no
Packaged 2017-05-18 16:07:32 UTC; jewellsean
Repository CRAN
Date/Publication 2017-05-18 16:16:25 UTC
imports graphics , stats
suggests testthat

Include our badge in your README