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 git@github.com:pillowlab/GLMspiketools.git
) or download as zip and then unzip the archive.
- From the main code directory (e.g.,
~/Downloads/GLMspiketools/
), run thesetpaths
script 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.
Demo Scripts:
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:
dtStim
specifies the size of time bins representing a single frame of the stimulus, anddtSp
specifies the size of time bins for spikes (both in units of seconds). The code requiresdtSp
to evenly dividedtStim
. Thus, for example, if the stimulus has a refresh rate of 100 Hz and spikes are represented with 1ms precision, thendtStim=.01
anddtSp=.001
. -
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 usegit checkout old_v1
, or download directly: GLMspiketools-old_v1.zip).