← What's New

Tier 1.1 — Multivariate (marked) time-rescaling GOF

2026-05-28 · nstat.fit (core) · branch feat/core-multivariate-time-rescaling

Why

The per-neuron univariate KS test (FitResult.computeKSStats) checks each neuron's marginal conditional intensity in isolation. It can pass for every neuron while the model still gets the coupling between neurons wrong — e.g. treating synchronous cells as independent. Detecting that requires a population-level test.

What shipped

Two complementary statistics:

from nstat import population_time_rescale
r = population_time_rescale(counts_per_neuron, lambda_per_bin_per_neuron, n_tau_bins=5)
r.ground_ks_pvalue   # population temporal GOF
r.mark_chi2_pvalue   # relative-allocation / coupling GOF

Validation

ScenarioResult
Correctly-specified populationneither statistic rejects
Wrong overall rateground KS rejects (χ² invariant — by design)
Synchronous pair modeled as independentper-neuron univariate KS both pass; population ground KS rejects (p≈3e-49)
Wrong relative allocation (right total)mark χ² rejects; ground KS passes
Single neuronground process = univariate rescaling

Notes

Files changed