nstat.population_time_rescale

nstat.population_time_rescale(counts_list, lam_per_bin_list, *, n_tau_bins=1)[source]

Multivariate (marked) time-rescaling goodness-of-fit for a population.

Implements the marked point-process time-rescaling framework of Tao, Weber, Arai & Eden (2018) for a population of neurons observed on a shared, uniformly-binned time grid. See PopulationTimeRescaleResult for the two statistics and what they detect; the headline is that the marked \(\chi^2\) (n_tau_bins > 1) catches inter-neuron coupling misfit that the per-neuron univariate KS test (FitResult.computeKSStats()) misses.

This is a Python-only extension (the 2018 method postdates the 2012 MATLAB nSTAT toolbox); it has no matlab_gold counterpart. It is pure NumPy/SciPy and operates on binned arrays, so it composes with any source of per-neuron intensities — e.g. a fitted GLM’s lambda signal (see FitResult.computeKSStats() for how nstat forms lambda) sampled on the same grid as the spike counts.

Parameters:
  • counts_list (Sequence[ndarray]) – Per-neuron spike counts per bin; a sequence of n_neurons arrays each shape (n_bins,). Usually 0/1 with fine bins.

  • lam_per_bin_list (Sequence[ndarray]) – Per-neuron model-expected counts per bin (\(\lambda_k(t)\,\Delta\)), same shapes as counts_list.

  • n_tau_bins (int) – Number of equal-\(\tau\) cells per neuron in the marked \(\chi^2\) partition (default 1 = pure mark-proportion test; > 1 adds within-neuron temporal resolution → coupling sensitivity). Keep the expected count per cell >= ~5 for the asymptotic \(\chi^2\) to be valid.

Return type:

PopulationTimeRescaleResult

See also

nstat.extras.spatial.marked_gof.multivariate_time_rescaling

Per-channel discrete-time-rescaling (Haslinger-Pipa-Brown 2010) for the finite-mark / multi-channel case at finite bin width. Per-channel passing is necessary but not sufficient; the present function provides the population coupling diagnostic that closes that gap.

nstat.extras.spatial.marked_gof.multivariate_gof_with_coupling

Wrapper that runs both this function and multivariate_time_rescaling() on the same data and returns both results.

References

Tao L, Weber KM, Arai K, Eden UT (2018). “A common goodness-of-fit framework for neural population models using marked point process time-rescaling.” J Comput Neurosci 45:147-162. Brown EN, Barbieri R, Ventura V, Kass RE, Frank LM (2002), Neural Computation 14:325-346 (the univariate special case).