Saturday, 6 July 2013

Spike Triggered Average

A spike triggered average is a method used in Neuroscience to determine the stimulus that a cell is selective for, by averaging over stimuli presented over a given time window before each spike. An efficient representation of this is the Wiener kernel formulation, which works when the stimulus can be characterised as Gaussian white noise, and works even better when it is possible to get synchronised noisy spike trains across many trials so as to smooth out some of the responses with the intrinsic noise. This basically cross-correlates the average spiking activity over many trials (not necessarily averaged across time, but some smoothing can be useful), and normalises by the variance of the stimulus to extract a filter that describes the system that relates stimulus to response. In other words, it's a model of a neuron that says the neuron is just a filter for the stimulus to output a spiking response.

One of the properties of Gaussian white noise is that all frequencies are present in the data, i.e., that samples are uncorrelated in time. However, as with any random sample it's likely there is some spurious autocorrelation present, so it's worth accounting for. In this case, a correction is quite easy to implement. It also reduces some of the need for regularisation

Again, in MATLAB:

function g = STA(r, s, window, lambda)

% Finds the first-order Wiener kernel g that corresponsds to the spike-triggered average of a neuron. Assume neural response r and stimulus s are row vectors. Lambda is regularisation constant. Window is the length of the filter to be extracted.

% Cross-correlate and extract filter.
xrs = xcorr(r - mean(r),s,window, 'unbiased');
xrs = xrs(1:window+1);

% Correct for autocorrelation

xss = xcorr(s, 2*window, 'unbiased');
xss = circshift(xss, [0, -2*window]);
xss = xss(1:window+1);
XSS = toeplitz(xss);

% Regularise

S = XSS + lambda*eye(size(XSS));

% Extract filter

g = S\xrs'; 

No comments:

Post a Comment