Shared computations

analyseur.cbgtc.stats.compute_shared.autocorr(x)[source]

Performs autocorrelation (biased normalized autocorrelation)

\[\rho(k) = \frac{\sum_{t=0}^{N-1-k}\tilde{x}_t \tilde{x}_{t+k}}{\sum_{t=0}^{N-1}\tilde{x}_t^2}\]

where \(k=0,1,\ldots,N-1\) and

\[\tilde{x}_t = x_t - \frac{1}{N}\sum_{t=0}^{N-1}x_t\]

Note that the Fourier transform of the biased normalized autocorrelation is the power spectrum (Wiener-Khinchin Theorem). Thus,

\[ \begin{align}\begin{aligned}P(f) &= \mathcal{F}\{\rho(k)\} \\\rho(k) &= \mathcal{F}^{-1}\{P(f)\}\end{aligned}\end{align} \]

Thus, the pipeline connects

\[x(t) \to \rho(k) \Leftrightarrow P(f)\]

See PowerSpectrum


analyseur.cbgtc.stats.compute_shared.compute_grand_mean(all_neuron_stat=None)[source]

Returns the grand/global mean of a given statistics of all the neurons in a nucleus.

Parameters:

all_neuron_stat

Returns:

a number


analyseur.cbgtc.stats.compute_shared.correlation_time(rho, binsz, method='zero_crossing')[source]

Returns correlation time \(\tau\) from autocorr()

\[ \begin{align}\begin{aligned}\tau &= \sum_{k=0}^\infty \rho(k)\Delta t \\&\approx \Delta t \sum_{k=0}^K \rho(k)\end{aligned}\end{align} \]

where \(\Delta t\) is the bin size and \(K\) is the cutoff where correlation \(\rho\) becomes negligible.

Guide

regime

frequency

CV

τ

asynchronous

none

~1

small

oscillatory

>0

<1

moderate

synchronized

strong

low

large

Therefore,

\[\tau = \Delta t \sum_{k=0}^K \rho(k)\]

measures how long the system remembers itself.