# How to interpret this autocorrelogram graph?

I am new to statistics. I found a script which makes a autocorrelogram graph(see attached) of spike timings of a neuron. I got the graph but I am not able to interpret it. Matlab Code below.

    function autocorrelogram(spiketimes)
%spiketimes = [10413177585,10413282812,10413379677,10413402313,10413410739,10413422026,..]
isi=[];
for i = 1:length(spiketimes)
isi = [isi; spiketimes-spiketimes(i)];
end
isi(isi>2000000)=[];
isi(isi<-2000000)=[];
isi=isi./1000000;
save isi;
figure
hist(isi,-2:0.02:2); What the above graph mean? At zero there is maximum correlation and after that the correlation decreases?

• By definition, autocorrelations lie in range [-1, 1], the figure that you show cannot be a plot of autocorrelations. – javlacalle Apr 29 '15 at 13:07
• Both terms refer to the same concept. Autocorrelations are the statistics (the values obtained applying the expression of the statistic), while the autocorrelogram is the plot of the autocorrelations. – javlacalle Apr 29 '15 at 13:19
• The distinction autocorrelation/autocorrelogram makes little sense. The term autocorrelogram or correlogram in my experience refers to a graph of the autocorrelation function and thus to the function itself. As @javlacalle rightly points out, this is not an autocorrelation as usually defined in statistics, but outside statistics there are related meanings. People who read MATLAB fluently can work out what it is, but that is not all of us. Perhaps it shows the autocovariance. – Nick Cox Apr 29 '15 at 13:20
• It appears from the code that the plot is an unnormalized histogram of all differences in spike times. To avoid confusion--this definitely is not an "autocorrelogram" in any standard statistical sense of the term--please edit this post to explain, in English or mathematical notation, exactly what the code is computing and plotting. – whuber Apr 29 '15 at 13:53
• Unfortunately, @javlacalle, in signal processing "autocorrelation" is not supposed to be confined to the [-1,1] range; I find it super confusing but that's how it is. Matlab follows this convention. See wikipedia on autocorrelation. – amoeba says Reinstate Monica Apr 29 '15 at 16:38

EDIT: I read your code wrong earlier. You are estimating the autocorrelation, not the ISI distribution as I thought before. Your variable name tricked me!!

Though the inter-spike-interval (ISI) distribution has a relation to autocorrelogram, they are not the same thing. The (unnormalized) autocorrelation (which should really be called auto-2nd-moment) of spike trains is usually defined as

$$Q(\tau) = E\left[x(t)x(t+\tau)\right]$$

where $x(t)$ is the spike train, and assuming some wide-sense stationarity (hence, doesn't depend on $t$). It's usually estimating by binning with a small window size such that in each bin there's either 0 or 1 spike, and averaging over time.

Now, the ISI distribution (which is not what you are estimating) can predict the autocorrelation function, if you additionally assume that your point process is a renewal process. Then the autocorrelation function is an infinite sum of k-convolutions of the ISI distribution (plus a peak at $\tau = 0$).

I hope this clarifies your confusion (of variable name).

I strongly recommend Theoretical Neuroscience by Dayan and Abbott.

Really weird. At first sight, this appears to be the AutoCorrelation of a Signal, in the Signal Processing sense, calculated as the convolution of the signal with itself (in the y axis), under a given delay (x axis). This would explains the symmetry and the big amplitude at zero.

But the code is showing something totally different: the spike values concatenated with itself with a time difference (x-axis), and then making an histogram from that (y-axis).

The graph gives the number of spikes(y-axis) as a function of time window(x-axis). Explaining further, One by one we take all the spikes of a spike train(the timestamps of spike of neurons) and w.r.t each spike calculate the number of other spikes happening in a given time window(+- 2 sec). Time window of +-2 sec is chosen because we are interested in that time range. The graph is symmetric along y-axis because suppose nth spike happened 1 sec after mth spike then mth spike happened 1 sec before nth spike. To summarize this graph shows the cumulative sum of number of spikes around each spike as a function of time lag, so at time lag 0 we get the total number of spikes in the spike train and as the time lag increases the number of spikes decrease. Next peaks are observed again where neuron fires again and so on. Also helps in seeing if neuron fires in a cyclic manner(tuned to some brain rhythm) which can be seen by peaks after the first peak. Below link gives a good description.

http://www.med.upenn.edu/mulab/crosscorrelation.html

• The code doesn't seem to do what you describe, but perhaps that is because we might have different concepts of what a "time window" is. Could you be more specific and detailed about your understanding of this plot? – whuber Apr 30 '15 at 16:58
• time window is the window of my interest. Added more info in the answer , let me know if it's ok now. – Coderaemon May 4 '15 at 6:00