Code Monkey home page Code Monkey logo

glmspiketools's Introduction

GLMspiketools

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

Download

  1. Either clone the repository from github (git clone [email protected]:pillowlab/GLMspiketools.git) or download as zip and then unzip the archive.

Basic Usage

  1. From the main code directory (e.g., ~/Downloads/GLMspiketools/), run the setpaths script to add relevant sub-directories to the matlab path.
  2. 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:

  1. demo1_GLM_temporalStim.m - simulates and fits GLM with 1D (purely temporal) stimulus.
  2. demo2_GLM_spatialStim.m - simulates and fits GLM with 2D (space x time) stimulus, and illustrates both linear and bilinear parametrization of stimulus filter.
  3. demo3_GLM_coupled.m - simulates and fits GLM with two coupled neurons

Notes

  • The code allows for two discretizations of time: dtStim specifies the size of time bins representing a single frame of the stimulus, and dtSp specifies the size of time bins for spikes (both in units of seconds). The code requires dtSp to evenly divide dtStim. Thus, for example, if the stimulus has a refresh rate of 100 Hz and spikes are represented with 1ms precision, then dtStim=.01 and dtSp=.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).

glmspiketools's People

Contributors

jpillow avatar neuromusic avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.