dirconn.significance_test#

dirconn.significance_test(estimator: Estimator, data: TimeSeries, *, test: str, surrogate: SurrogateGenerator | str | None = None, n_surrogates: int | None = None, block_size: int | None = None, seed: int | None = None, reduce: Callable[[Connectivity], Connectivity] | str | Sequence[float] | None = None, alpha: float = 0.05) → SurrogateTestResult | AnalyticTestResult | AsymptoticTestResult#

Test the significance of an estimator’s result.

There is no default test: which null hypothesis you test is a choice, and each result states it (result.null) together with its limitations. Arguments that the chosen test does not use are refused rather than ignored.

Parameters:
  • estimator (Estimator) – The connectivity estimator.

  • data (TimeSeries) – Input data.

  • test ({"surrogate", "block_perm", "analytic"}) – "surrogate": compare with surrogates from surrogate (see dirconn.surrogate_test()); needs surrogate, n_surrogates and seed. "block_perm": block shuffling for continuous data (see dirconn.stats.surrogates.BlockShuffle); needs block_size, n_surrogates and seed. "analytic": the test that belongs to the estimator’s class, the F test of GC (dirconn.analytic_gc_test()) or the asymptotic per-frequency tests of PDC and RPDC (dirconn.analytic_pdc_test(), dirconn.analytic_rpdc_test()); takes no other test arguments.

  • surrogate (SurrogateGenerator or str, optional) – A generator instance, or the name of one that needs no parameters: "phase_randomize", "aaft", "iaaft", "circular_shift", "trial_shuffle".

  • n_surrogates (int, optional) – Number of surrogates.

  • block_size (int, optional) – Block length in samples for "block_perm".

  • seed (int, optional) – Seed of the random generators; required by the two resampling tests.

  • reduce (callable, str or (float, float), optional) – Defines the tested family for the resampling tests (see dirconn.surrogate_test()).

  • alpha (float) – Default level for result.significant() and the power check.

Returns:

All offer pvalues, null, limitations, adjusted() and significant().

Return type:

SurrogateTestResult, AnalyticTestResult or AsymptoticTestResult