Sparsity Index of CBGTC spike times

class analyseur.cbgtc.analytics.ratesparsity.Sparsity[source]

Bases: object

Sparsity or sparsity index is a measure of how concentrated or distributed the firing is across the neurons in the population. It quantifies

  • sparse coding; measure of whether a few neurons do most of the firing

  • dense coding; measure of evenly distributed firings across the neurons (in the population)

Mathematically, sparsity index is the ratio of mean rates and the mean squared rates subtracted from unity.


classmethod analyze(firing_rates, baseline_rates, response_rates)[source]

Formula

Definitions

Interpretation

total neurons, \(n_{Nuc}\)

total number of neurons in the Nucleus

neuron index, \(i\)

i-th neuron in the pool of \(n_{Nuc}\) neurons

frequency, \(f^{(i)}\)

firing rate of i-th neuron

\(\vec{f} = [f^{(i)}]_{\forall{i} \in [1, n_{Nuc}],}\)

firing rates of all (\(n_{Nuc}\)) neurons

\(\psi^{(i)}\)

sparsity index of i-th neuron

\(\vec{\psi} = [\psi^{(i)}]_{\forall{i} \in [1, n_{Nuc}],}\)

sparsity indices of all (\(n_{Nuc}\)) neurons

Then the sparsity index vector is defined as

\[\vec{\psi} = 1 - \frac{\mu\left(\vec{f}\right)^2}{\mu\left(\vec{f}^2\right)}\]

Let \(\vec{\beta}\) be the firing rates of all the neurons prior to stimulus onset (baseline firing rate) and \(\vec{\rho}\) be the firing rates of all the neurons at and after stimulus onset (response firing rate). Then their sparsity is given by

\[ \begin{align}\begin{aligned}\vec{\psi}_{\beta} &= 1 - \frac{\mu\left(\vec{\beta}\right)^2}{\mu\left(\vec{\beta}^2\right)} \\\vec{\psi}_{\rho} &= 1 - \frac{\mu\left(\vec{\rho}\right)^2}{\mu\left(\vec{\rho}^2\right)}\end{aligned}\end{align} \]

and sparsity change is

\[\Delta = \vec{\psi}_{\rho} - \vec{\psi}_{\beta}\]

static biointerpret_sparsity_index(sparsity_value, brain_region='unknown')[source]

Interpret the given sparsity value \(\psi\) in a biological context


static interpret_sparsity_index(sparsity_value)[source]

Interpret the given sparsity value \(\psi\). Going with the hypothesis that

  • “only a small fraction of neurons are active at any one time”

  • average biological neuronal activity ratio “typically” ranges from near 0 to about 0.5, i.e, \((0, 0.5)\)

  • activity ratio above 0.5 cannot be considered sparse because same efficiency can be achieved by inversion

we interpret \(\psi \in (0, 0.3)\) to low sparsity and \(\psi \in (0.7, 1.0)\) to high sparsity. For greater granularity this is further broken down to

  • \([0, 0.2)\): very dense (most neurons are active)

  • \((0.2, 0.4)\): dense (firing is distributed)

  • \((0.4, 0.6)\): moderate (mixed activity)

  • \((0.6, 0.8)\): sparse

  • \((0.8, 1.0)\): very sparse (few neurons are active)


static mathinterpret_sparsity_index(sparsity_value, brain_region='unknown')[source]