Skip to content

Produces a model of the relationship between an extrinisic observable signal and an intrinsic covarying spike train

License

Notifications You must be signed in to change notification settings

hasselmonians/neural-decoder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

neural-decoder

Produces a model of the relationship between an extrinsic observable signal and an intrinsic covarying spike train. The model assumes that the relationship between firing rate and and the raw observable signal (e.g. running speed) can be modeled by a convolution with an exponentially-modified Gaussian kernel (a linear mapping). The model also assumes that the relationship between firing rate and the spike train is that the former generates the latter by a Poisson process. Given the raw signal and the spike train, one can work backwards to estimate the parameters of the kernel.

The two most important kernel parameters are mu and tau, which correspond to lag and decay respectively.

Dependencies

You will need

Description of the model

The relationship between the extrinsic observable signal (the raw signal) and an intrinsic covarying spike train (the spike train) is assumed to be mediated by a latent signal (the firing rate, or transformed signal).

Text diagram of the model

     conv. w/ kernel       Poisson process
           |                     |
raw signal -> transformed signal -> spike train

Transforming the raw signal

The relationship between the raw signal and the transformed signal is defined by a convolution with an exponentially-modified Gaussian kernel.

transformed_signal = conv(kernel, raw_signal)

The kernel used here has four parameters. All parameters are positive, real constants.

  • alpha: scaling parameter
  • mu: mean parameter
  • sigma: standard deviation parameter
  • tau: time constant parameter

The two most important parameters are mu and tau. Mu determines the degree of lag between the raw signal and the transformed signal. Tau determines the (inverse) rate of decay of the transformed signal.

Generating the spike train

The spike train is assumed to be generated by a non-homogeneous Poisson process.

spike_train = poisson(transformed_signal)

An illustrated example

Here is some artificial sample data showing animal running speed (an extrinsic, observable signal) and a sample kernel. The kernel is used to define the relationship between the extrinsic time-series and the intrinsic spike train.

test_kernel

Here we show the raw signal, the transformed signal produced by convolving the raw signal with the kernel, and a spike train generated by treating the transformed signal as the generating function of a non-homogeneous Poisson process.

In terms of an experiment, the raw signal (e.g. running speed) is observable, as is the spike train. By making certain assumptions about how the signals are related, we can attempt to reconstruct a kernel that best matches the given data.

We perform an iterative optimization process in which we select parameters and evaluate a goodness-of-fit metric.

In the example below, we have used a simple raw signal and known kernel with parameters (alpha, mu, sigma, tau) = (0.2, 10, sqrt(3), 10). We will work backwards to estimate the kernel parameters assuming we were only given the raw signal and the spike train.

test_kernel

The objective function

The quality of the fit of the kernel is evaluated by an objective function, which maps the four parameters to a real, positive scalar value called the objective or the cost. A "good" objective is as close to zero as possible.

The objective function used here is intimately related to the log-likelihood of the given spike train having been generated by a Poisson process with inhomogeneous rate function equal to the raw signal transformed by the kernel with given parameters.

Since our model assumes that the spike train is generated by a Poisson process with the transformed signal as the non-homogeneous rate parameter, we can estimate the transformed signal by maximizing the likelihood of a Poisson distribution and work backwards to estimate the kernel parameters.

The relationship between objective function and log-likelihood is shown below. Importantly, the objective function is monotonically decreasing with respect to increasing log-likelihood. This means that there should be some parameters of the kernel that maximize the log-likelihood and minimize the objective function.

The objective function reaches its global minimum for the parameters that generated the transformed data. Here, the parameters (0.2, 10, sqrt(3), 10) were used to transform the sample data as shown above.

The second and fourth parameters (mu and tau) were varied, the convolution performed, and the objective function computed. We see that the objective value is minimized when the parameters (0.2, 10, sqrt(3), 10) are used to generate the EMG kernel.

This is a contrived example since we know the kernel parameters a priori. In a real experiment, we would know the raw signal and the spike train and would work backwards to estimate kernel parameters.

About

Produces a model of the relationship between an extrinisic observable signal and an intrinsic covarying spike train

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published