Neural Timescale Analysis · iSTTC Method · good_isttc

Intrinsic timescales
across brain regions

Spontaneous spiking activity from 154 sessions. Autocorrelation decay fitted with 1–4 exponential components via iSTTC (Pochinok et al., 2025) + BIC model selection (Shi et al., 2025). All units passed quality filter.

r² ≥ 0.5 CI excludes zero ACF decline 50–200 ms ≥ 100 spikes
23,660
Total units
4.3 Hz
Median firing rate
300 ms
Median τ effective
199
Unique brain regions
01
Timescale × Brain Region
Median effective timescale (τ) for the 15 most-sampled regions, sorted descending.
τ > 500 ms 200–500 ms τ < 200 ms
02
Timescale × Major Brain Division
Comparing median effective τ across grouped forebrain, midbrain, and hindbrain structures.
Forebrain (Ctx/Hippo/BG/Thal) Midbrain (MRN/PRNr) Hindbrain (SPVI)
Hierarchy validated: Aligning with Shi et al. (2025), there is a ~8× jump in timescale magnitude from the forebrain (110 ms median) to the midbrain complex (868 ms), establishing a massive hierarchical gradient in temporal integration.
03
Timescale × Firing Rate
Median τ effective per firing rate bin, with unit count overlay.
Median τ (left axis) Unit count (right axis)
04
Timescale × Local Variance (Lv)
Lv measures inter-spike interval regularity. Lv ≈ 1 is Poisson-like; Lv < 1 is more regular; Lv > 1 is more bursty.
Median τ effective (ms)
05 — 06
τ Distribution & N Timescales
Left: histogram of τ effective across all 23,660 units. Right: number of exponential components needed to fit the ACF.
Unit count per τ bin
n_timescales distribution
07
Timescale Components — τ₁ through τ₄
Median value of each fitted timescale component across all neurons.
τ₁ — 1st comp
52.4 ms
n = 23,660
τ₂ — 2nd comp
1,034 ms
n = 17,203
τ₃ — 3rd comp
2,929 ms
n = 3,151
τ₄ — 4th comp
4,489 ms
n = 22
Median τ₁ and τ₂ per brain region
Median τ₁ Median τ₂
08
Multiscale Architecture: τ₁ vs τ₂
Testing the hypothesis that fast components (τ₁) drive regional differences while slow components (τ₂) act as universal baseline dynamics.
Top 15 Regions (Log-Log Scale)
Regional vs Universal: While τ₁ varies widely across regions (from ~19ms in CA1 to ~278ms in V), τ₂ maintains a proportionally higher baseline in regions with long τ₁, demonstrating a coupled multiscale architecture where local circuit properties (τ₁) scale alongside slower network states (τ₂).
09
τ₂ Power-Law Distribution
Log-log histogram of τ₂ across the population to test scale-free dynamics (theoretical exponent ≈ −2).
τ₂ Unit Count (Log-Log Scale)
Deviation from Scale-free Dynamics: Unlike a pure power-law (linear descent on log-log), the empirical data shows a broad plateau between 1,000 and 3,500 ms. Slow fluctuations cluster in a preferred "slow state" frequency band — inconsistent with strict neural criticality.
10
Fit Reliability & Amplitude Metrics
Evaluating model confidence (R² per region, CI width) and coefficient magnitude (c₁ vs τ₁).
Median R² per Region (Top 15)
R² ≥ 0.85 R² < 0.85
Amplitude (c₁) vs τ₁ (Top 30 regions)
Median Region Data
Confidence Interval Width (95%) vs Effective τ
Estimation limits & Amplitude tradeoff: Long τ estimates carry proportionally wider CIs. There is also a strong inverse relationship between c₁ and τ₁ — regions with short τ₁ (e.g. CA1, SSp) show high initial autocorrelation amplitude (c₁ ≈ 0.20), while long-τ₁ regions (brainstem) show attenuated amplitudes (c₁ ≈ 0.07).

iSTTC Notebook: Function & Code Documentation

This notebook was developed to estimate intrinsic neural timescales (ITs) from single-unit recordings spanning the entire mouse brain. Timescales are defined as the decay time constant of the autocorrelation function of spontaneous neural activity, and reflect how neural circuits integrate information over time (Murray et al., 2014; Pochinok et al., 2025).

The notebook integrates two complementary approaches: (1) computation of the autocorrelation function using the iSTTC method developed by Pochinok et al. (2025), and (2) multi-exponential model fitting as defined by Shi et al. (2025).

iSTTC Method

Spike Train Tiling Coefficient adapted for intrinsic timescales. Reduces systematic bias in ACF estimation — particularly under low firing rates and bursty dynamics.

Multi-Exponential Fitting

ACF modeled as a sum of M exponential components (M = 1–4) selected by BIC. Captures multiple linear slopes in single-neuron autocorrelations that single-exponential models miss.

Dataset

IBL Neuropixels dataset — 115 mice, 223 brain regions. The same brain-wide recording dataset used in Shi et al. (2025) (IBL, 2023).

Environment

Designed to run in Google Colab. Mounts Google Drive, installs ONE-api, numpy, scipy, numba, joblib.

Setup & Dependencies

The first cell mounts Google Drive and installs all required packages. The working directory is set to the shared drive hosting the IBL dataset. Dependencies include:

  • ONE-api — IBL's open data access library
  • numpy, scipy — numerical and optimization routines
  • numba — JIT compilation for the iSTTC kernel
  • joblib — parallelized session-level processing
  • matplotlib — single-neuron visualization

iSTTC Implementation

The iSTTC computes the autocorrelation-like function directly on spike times, avoiding binary representations or binning. All inner functions are JIT-compiled via Numba's @njit decorator for maximum efficiency.

1 _tiling_proportion_nb Computing T_A

Computes the tiling proportion term (T_A) from the STTC formula: the fraction of the total recording duration that falls within Δt of any spike in the spike train. Following Pochinok et al. (2025), Equation 5:

T_A = (duration within Δt of any spike) / (total duration)
Eq. 5 — Pochinok et al. (2025)

The function accepts spike times array, valid window boundaries (start, end), the Δt window width, total recording duration, and a time shift. Critically, this implementation operates directly on spike times without requiring binary representation or binning — a key distinction from conventional ACF approaches.

2 _spikes_in_tiling_nb Computing P_A|B

Computes the P_A|B term: the fraction of spikes in train A that fall within Δt of any spike in train B. A binary search algorithm is used for efficient neighborhood queries over the reference spike train for each test spike.

As demonstrated by Pochinok et al. (2025), this approach yields substantially lower relative estimation error (REE) compared to binned ACF methods, particularly under low firing rate and high excitation strength conditions (Figure 2 of that paper).

3 _isttc_nb iSTTC Lag Loop

The core iSTTC computation function. Following Pochinok et al. (2025), Equation 6, the original spike train is split into two segments for each lag k:

  • Spike train A: spikes occurring after lag k (shifted)
  • Spike train B: spikes occurring before lag k (unshifted)

The STTC formula is then applied using the computed T_A, T_B, P_A|B, and P_B|A terms at each lag:

iSTTC_lag=k = ½ · ( (P_k:T − T_1:T-k) / (1 − P_k:T · T_1:T-k) + (P_1:T-k − T_k:T) / (1 − P_1:T-k · T_k:T) )
Eq. 6 — Pochinok et al. (2025)

A critical implementation detail: zero-padded intervals are excluded when computing the T term. This allows iSTTC to be applied without bias to epoched data — overcoming a fundamental limitation of PearsonR-based approaches.

4 calculate_isttc Main Wrapper Function

The user-facing interface function. Sorts spike times and casts them to np.float64 before calling the JIT-compiled kernel. Default parameters are:

  • Δt = 5 ms — tiling window width
  • n_lags = 1200 — number of lags computed
  • lag_shift = 5 ms — consistent with Pochinok et al. (2025), Section 7.4

Multi-Exponential Model Fitting

5 _multi_exp Multi-Component Exponential Model

Implements the autocorrelation model defined in Shi et al. (2025), Equation 2:

AC(t) = Σᵢ cᵢ · exp(−t / τᵢ), i = 1 … M
Eq. 2 — Shi et al. (2025) · τᵢ = timescales, cᵢ = mixing coefficients, M = number of components

The model was developed to capture the multiple linear slopes observed in single-neuron autocorrelations, which a single exponential is insufficient to describe.

6 fit_multi_exponential BIC-Based Model Selection

Implements the multi-timescale estimation procedure described in Shi et al. (2025). Exponential models with M = 1, 2, 3, 4 components are fit using nonlinear least squares via scipy.optimize.curve_fit. Initial parameters are spaced on a logarithmic scale; lower bound = 5 ms (physiological minimum), upper bound = maximum measured lag.

BIC Model Selection

The optimal number of components is selected using the Bayesian Information Criterion:

BIC = n · ln(SS_res / n) + k · ln(n)
n = number of data points, k = number of model parameters

A constraint requires each timescale component to contribute at least 1% of the total autocorrelation: cᵢ ≥ 0.01 · Σⱼ cⱼ.

Effective Timescale

The effective timescale is computed following Shi et al. (2025), Equation 3:

τ_eff = (Σᵢ cᵢ · τᵢ) / (Σᵢ cᵢ)
Eq. 3 — Shi et al. (2025) · amplitude-weighted average across all M* components

This enables direct comparison across neurons with differing numbers of fitted timescales, and represents the overall temporal persistence — equivalent in area to a single exponential decay with timescale τ_eff.

Confidence Interval

A 95% CI for τ_eff is computed by applying error propagation to the covariance matrix, using Student's t distribution to account for small sample sizes.

Local Variance (Lv)

7 compute_local_variance Burstiness Proxy

Local Variance (Lv) is computed following Shinomoto et al. (2009):

Lv = (3 / (n−1)) · Σᵢ₌₁ⁿ⁻¹ [ (Iᵢ − Iᵢ₊₁) / (Iᵢ + Iᵢ₊₁) ]²
Iᵢ = inter-spike intervals · Shinomoto et al. (2009)

Pochinok et al. (2025) demonstrated that Lv correlates tightly with the excitation strength parameter of the Hawkes process, and thus serves as an experimentally observable proxy for excitation strength.

Lv = 1

Poisson firing dynamics — random inter-spike intervals

Lv < 1

Regular, oscillatory firing — more predictable ISI structure

Lv > 1

Bursty firing — clusters of spikes followed by long silences

Key insight

iSTTC advantage is most pronounced under Lv > 1 — the bursty, low-rate regime characteristic of neocortical activity

Quality Control Criteria

8 check_quality_criteria Four Inclusion Criteria

Implements the inclusion criteria reported in Pochinok et al. (2025), Section 2.5, and in the Methods of Shi et al. (2025). Four criteria are assessed:

ACF Decline

The iSTTC function must decline monotonically within the 50–200 ms window. Coefficient estimate = −0.946, p < 10⁻¹⁶ as a predictor of REE (Pochinok et al., 2025).

Confidence Interval

The 95% CI of the estimated τ_eff must exclude zero. Coefficient estimate = −1.325, p < 10⁻¹⁶ as a predictor of REE.

R² Threshold

Model fit must satisfy R² ≥ 0.5. Consistent with Shi et al. (2025) and prior single-neuron timescale studies (Cavanagh et al., 2016; Wasmuht et al., 2018).

Spike Count

Neuron must contain ≥ 100 spikes. Guards against unreliable estimates from neurons that only fire briefly.

Pochinok et al. (2025) demonstrated that iSTTC increases the proportion of neurons meeting all criteria on epoched data by approximately 7–8% relative to PearsonR (Figure 5E).

Spontaneous Activity Window

9 get_spontaneous_window IBL Passive Period Extraction

Extracts the temporal boundaries of the IBL spontaneous activity recording epoch. Following Shi et al. (2025), spontaneous activity was recorded during a 10-minute passive period at the end of each session, during which head-fixed mice remained stationary in the rig in a dark environment with no visual stimuli or reward delivery.

Neural activity during this passive period was used as a proxy for spontaneous activity to estimate intrinsic timescales.

Single Neuron & Session Analysis

10 analyze_single_neuron End-to-End Single Unit Pipeline

The end-to-end analysis function for a single neuron. It sequentially:

  • Computes the iSTTC autocorrelation function
  • Fits the multi-exponential model with BIC-based model selection
  • Evaluates all four quality control criteria
  • Computes firing rate and Lv metrics

The output includes τ_eff, individual τᵢ and cᵢ values, fit quality metrics, and the raw autocorrelation and fitted curves for each neuron.

11 _process_cluster Parallel Worker Function

The unit of work for each individual neuron cluster. It validates neural unit quality via IBL quality control labels (retaining only well-isolated single units with label ≥ 2), checks the minimum spike count threshold, calls analyze_single_neuron, and merges results with session-level metadata (session ID, probe name, cluster ID, brain region coordinates).

12 analyze_session Full IBL Session Analysis

Performs the full analysis of a single IBL session. It downloads neural data via the ONE API, identifies the spontaneous activity window using get_spontaneous_window, filters spike times to that window, and runs _process_cluster in parallel across all clusters using joblib.Parallel. This parallelized design enables efficient processing of sessions with large numbers of neurons.

Visualization

13 plot_single_neuron Two-Panel Neuron Output

Produces a two-panel output for a single neuron:

  • Left panel: raw iSTTC autocorrelation points (blue) and the multi-exponential fit curve (red), along with fit information (number of components, τ_eff, R²) and the 50–200 ms quality control window.
  • Right panel: a summary of neuron metrics — firing rate, Lv, spike count, individual timescales and mixing coefficients, confidence intervals, and quality control outcomes.

Batch Processing Infrastructure

14 get_next_pids · mark_isttc_done · run_batch Distributed Processing Coordination

These three functions constitute the coordination infrastructure for distributed data processing across team members:

  • get_next_pids — retrieves the next unprocessed PIDs assigned to a given team member from a CSV registry file.
  • mark_isttc_done — updates the registry upon successful completion of a session.
  • run_batch — connects to the IBL ONE API, processes the specified number of sessions sequentially, saves results incrementally to a CSV file after each session, and updates the registry. Incremental saving minimizes data loss during long-running analyses.

Parameter Summary

ParameterValueSource
Δt (iSTTC window)25 msPochinok et al. (2025), Section 7.4
lag_shift5–10 msPochinok et al. (2025)
n_lags600–1200This notebook
Maximum components4Shi et al. (2025)
Min. component contribution1%Shi et al. (2025)
R² threshold≥ 0.5Pochinok et al. (2025); Shi et al. (2025)
Min. spike count100This notebook
Spontaneous activity duration~10 minShi et al. (2025)

Methodological Rationale

This notebook integrates two complementary methodological frameworks. As demonstrated by Pochinok et al. (2025), the iSTTC method reduces systematic biases in the autocorrelation estimation step, yielding approximately 8% lower REE compared to ACF — particularly under low firing rates and bursty dynamics.

When compared to epoched data, IT estimates derived from continuous recordings with iSTTC show approximately ten-fold lower REE, underscoring the importance of using continuous spontaneous activity recordings whenever possible.

The multi-timescale model of Shi et al. (2025), in turn, captures the multiple linear slopes observed in single-neuron autocorrelations that standard single-exponential approaches fail to describe — as the majority of neurons in that study (51%) were best described by a two-component model. This aligns with the 59% two-component prevalence observed in the present dataset.

References

  • Cavanagh SE, Wallis JD, Kennerley SW, Hunt LT (2016). Autocorrelation structure at rest predicts value correlates of single neurons during reward-guided choice. eLife 5:e18937.
  • International Brain Laboratory (2023). A brain-wide map of neural activity during complex behaviour. bioRxiv.
  • Murray JD, Bernacchia A, Freedman DJ et al. (2014). A hierarchy of intrinsic timescales across primate cortex. Nature Neuroscience 17:1661–1663.
  • Pochinok I, Hanganu-Opatz IL, Chini M (2025). iSTTC: a robust method for accurate estimation of intrinsic neural timescales from single-unit recordings. bioRxiv. doi.org/10.1101/2025.08.01.668071
  • Shi Y-L, Zeraati R, International Brain Laboratory, Levina A, Engel TA (2025). Brain-wide organization of intrinsic timescales at single-neuron resolution. bioRxiv. doi.org/10.1101/2025.08.30.673281
  • Shinomoto S, Kim H, Shimokawa T et al. (2009). Relating neuronal firing patterns to functional differentiation of cerebral cortex. PLoS Computational Biology 5:e1000433.
  • Wasmuht DF, Spaak E, Buschman TJ, Miller EK, Stokes MG (2018). Intrinsic neuronal dynamics predict distinct functional roles during working memory. Nature Communications 9:3499.