nstat.PopulationTimeRescaleResult

class nstat.PopulationTimeRescaleResult(ground_uniforms, ground_ks_stat, ground_ks_pvalue, mark_chi2_stat, mark_chi2_dof, mark_chi2_pvalue, expected_counts, observed_counts)[source]

Bases: object

Population-level (multivariate) time-rescaling GOF result.

The univariate KS test (FitResult.computeKSStats()) checks each neuron’s marginal conditional intensity in isolation — it can pass even when a model gets the coupling between neurons wrong. The marked point-process time-rescaling framework of Tao, Weber, Arai & Eden (2018) tests the population jointly and exposes exactly those failures. Two complementary statistics are returned:

  1. Ground-process KS — pool every neuron’s spikes into one “ground” process with intensity \(\lambda_\bullet(t) = \sum_k \lambda_k(t)\), rescale it by \(\Lambda_\bullet\), and KS-test the rescaled inter-event intervals against the unit exponential. Detects misfit in the population’s aggregate temporal structure.

  2. Marked-region Pearson \(\chi^2\) — each spike of neuron \(k\) maps to a point \((\tau, k)\) with \(\tau = \int_0^{s}\lambda_k\); under a correct model these points are uniform over the region \(R = \{(\tau, m): 0 \le \tau \le b(m)\}\), \(b(m)=\int_0^T\lambda_m\). A Pearson \(\chi^2\) over a partition of \(R\) tests that uniformity. With n_tau_bins > 1 the partition resolves within-neuron timing, making the test sensitive to mis-modeled coupling (because \(\lambda_k(t\,|\,H_t)\) depends on other neurons’ spike history).

Variables:
  • ground_uniforms (numpy.ndarray) – Rescaled ground-process inter-event values, mapped to [0, 1] via \(1-e^{-\xi}\) (uniform under the null).

  • ground_ks_stat (float) – KS statistic and asymptotic p-value of ground_uniforms vs. Uniform(0, 1). nan if fewer than 2 pooled events.

  • ground_ks_pvalue (float) – See ground_ks_stat.

  • mark_chi2_stat (float) – Pearson \(\chi^2\) for uniform fill of \(R\), its degrees of freedom (n_cells - 1), and upper-tail p-value.

  • mark_chi2_dof (int) – See mark_chi2_stat.

  • mark_chi2_pvalue (float) – See mark_chi2_stat.

  • expected_counts (numpy.ndarray) – \(b(m)\) per neuron — the model-expected spike count (\(\int\lambda_m\)), shape (n_neurons,).

  • observed_counts (numpy.ndarray) – Observed total spike count per neuron, shape (n_neurons,).

Parameters:
__init__(ground_uniforms, ground_ks_stat, ground_ks_pvalue, mark_chi2_stat, mark_chi2_dof, mark_chi2_pvalue, expected_counts, observed_counts)
Parameters:
Return type:

None

ground_uniforms: ndarray
ground_ks_stat: float
ground_ks_pvalue: float
mark_chi2_stat: float
mark_chi2_dof: int
mark_chi2_pvalue: float
expected_counts: ndarray
observed_counts: ndarray