Fitting and simulation of Poisson generalized linear model for single and multi-neuron spike trains (Pillow et al 2008).
Description: Simulates and computes maximum likelihood estimates for the parameters of a Poisson GLM spike train model. Parameters consist of a bank of stimulus filters ("receptive fields"), spike-history filters, and coupling filters that capture dependencies between neurons. The stimulus filter can be parametrized linearly or bi-linearly, and the nonlinearity can be selected from a class ensuring convexity of the negative log-likelihood, or parametrized using using cubic splines. This model is a generalization of the "Linear-Nonlinear-Poisson" model that incorporates spike-history effects and correlations between neurons.
Relevant publication: Pillow et al, Nature 2008
- Either clone the repository from github (
git clone email@example.com:pillowlab/GLMspiketools.git) or download as zip and then unzip the archive.
- From the main code directory (e.g.,
~/Downloads/GLMspiketools/), run the
setpathsscript to add relevant sub-directories to the matlab path.
- Examine demo scripts in sub-directory
demos/to see simple scripts illustrating how to simulate and fit the GLM to spike train data.
demo1_GLM_temporalStim.m- simulates and fits GLM with 1D (purely temporal) stimulus.
demo2_GLM_spatialStim.m- simulates and fits GLM with 2D (space x time) stimulus, and illustrates both linear and bilinear parametrization of stimulus filter.
demo3_GLM_coupled.m- simulates and fits GLM with two coupled neurons
The code allows for two discretizations of time:
dtStimspecifies the size of time bins representing a single frame of the stimulus, and
dtSpspecifies the size of time bins for spikes (both in units of seconds). The code requires
dtSpto evenly divide
dtStim. Thus, for example, if the stimulus has a refresh rate of 100 Hz and spikes are represented with 1ms precision, then
fitting code relies on the matlab optimization toolbox function "fminunc".
An older release of this code (now sitting in branch
old_v1) had functionality that is no longer supported. Namely: cubic spline parametrization of the nonlinearity, and a smart "chunking" of the design matrix that was more memory efficient (albeit slightly slower). If memory issues are a problem, due to large stimulus or coupling from many neurons, we suggest checking out version v1. (In the shell use
git checkout old_v1, or download directly: GLMspiketools-old_v1.zip).