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