Concepts & Background

This section teaches the neuroscience and statistics behind nSTAT, not just the API. It is written for students and newcomers: each page builds intuition first, then shows the matching nSTAT objects and a runnable snippet, and cites the primary literature so you can go deeper. No prior neuroscience is assumed.

Jump in by goal: I want to…   fit a GLM · check a model’s fit · analyze LFP / spectra · decode a stimulus/state · model learning across trials · measure coupling between neurons · report uncertainty · avoid common mistakes · look up a term.

Every page in this track opens with a Glossary jumps box linking to the relevant entries in the glossary — direct deep-links to plain definitions of every term.

Suggested learning path

  1. Microelectrode recordings: spikes and the LFP — what an electrode actually measures, how the broadband signal splits into spikes and the LFP, single- vs multi-unit activity, and spike sorting. The physical grounding for everything else.

  2. Spike trains and point-process GLMs — spike trains as point processes, the conditional intensity function, and fitting it with point-process GLMs (stimulus + history + ensemble). The core encoding model.

  3. The LFP and spectral analysis — the local field potential and the continuous-signal tools: multitaper spectra, spectrograms, and Kalman filtering (applies to LFP, EEG, ECoG).

  4. Goodness-of-fit and decoding — the time-rescaling KS test, population goodness-of-fit, and reading the stimulus/state back out with point-process and clusterless decoders.

  5. State-space models: learning dynamics and EM — models whose parameters change over time: the across-trial state-space GLM (SSGLM) and EM-trained latent state-space models. Where to go after the static GLM.

  6. Network connectivity and functional coupling — how neurons influence each other (ensemble GLM terms, cross-correlograms, Granger), and why correlation is not connection.

Hands-on companions (both run on simulated data, no download):

Going further (once the core pages click):

  • Rhythmic firing and the clinical microelectrode — oscillatory (tremor) cells modeled as a point-process GLM with a periodic covariate, and the applied setting of a microelectrode advanced into a deep brain nucleus during DBS surgery — firing-rate localization, the beta-band field-potential biomarker, and reading the rhythm back out with the PPAF.

  • Uncertainty and confidence intervals — how nSTAT quantifies the uncertainty in every estimate, and why an estimate without an interval is only half an answer.

  • Population geometry — from single-neuron models to the low-dimensional neural manifold a population traces out.

  • From filters to deep learning — how nSTAT’s classical decoders connect to modern deep-learning and foundation models for neural data.

  • Further study — a short map of topics nSTAT does not implement, with primary references for each.

  • Self-check — quizzes for every topic plus cross-cutting synthesis questions.

Reference material:

  • Common pitfalls & FAQ — the mistakes that quietly invalidate an analysis, and how to avoid them. Skim before your first real analysis.

  • Glossary — plain-language definitions, each linked to the relevant nSTAT object.

  • Annotated bibliography — the primary sources, with a note on why each matters for nSTAT users.

How the concepts map to nSTAT

The nSTAT analysis pipeline: raw data to nSTAT objects to Trial+TrialConfig to Analysis to FitResult, branching into goodness-of-fit, model comparison, and decoding

The pipeline at a glance: raw data become nSTAT objects, a Trial plus a TrialConfig specify the model, Analysis fits it, and the resulting FitResult feeds goodness-of-fit, model comparison, and decoding.

Concept

nSTAT objects

Example

Spike trains

nspikeTrain, nstColl

nSpikeTrainExamples.ipynb

Encoding GLM

Analysis, TrialConfig, FitResult

Paper Example 02

Across-trial learning (SSGLM)

nstColl.ssglm() / ssglmFB()

Paper Example 03

EM-trained state-space models

nstat.extras.em.dynamax_bridge

examples/extras/em_dynamax_demo.py

Goodness-of-fit

FitResult.computeKSStats, population_time_rescale

Paper Examples 01–03

LFP / spectra

SignalObj (MTMspectrum, spectrogram)

SignalObjExamples.ipynb

Decoding

DecodingAlgorithms (PPAF/PPHF), clusterless_bridge

Paper Example 05

Functional coupling

TrialConfig ensemble terms, Analysis (Granger)

network_coupling.py

Rhythmic / tremor cells

periodic Covariate, Analysis, FitResult

clinical_microelectrode_walkthrough.py

Beta biomarker (adaptive DBS)

SignalObj (MTMspectrum, spectrogram)

clinical_microelectrode_walkthrough.py

Once the concepts are clear, see the Paper-aligned toolbox map for the full API crosswalk and the paper-example gallery for worked analyses with figures.