dirconn.SurrogateTestResult#

class dirconn.SurrogateTestResult(observed: Connectivity, pvalues: ndarray, effect: ndarray, zscore: ndarray, null: str, limitations: tuple[str, ...], generator: dict[str, Any], n_surrogates: int, seed: int, alpha: float, checks: AssumptionChecklist)#

Outcome of a surrogate test, with the premise it rests on.

All arrays have the shape of observed.values, (source, target, freq, time). Cells that are undefined in the observed result (for example the diagonal) are NaN in pvalues, effect and zscore, and are not part of any multiple-comparison family.

observed#

The tested result (after reduce), with its provenance.

Type:

Connectivity

pvalues#

(count(|null| >= |observed|) + 1) / (n_surrogates + 1), two-sided on magnitudes. The smallest possible value is 1 / (n_surrogates + 1).

Type:

ndarray

effect#

|observed| minus the mean surrogate magnitude.

Type:

ndarray

zscore#

effect divided by the standard deviation (ddof 1) of the surrogate magnitudes; NaN where that is zero or undefined.

Type:

ndarray

null#

The null hypothesis that the surrogates represent.

Type:

str

limitations#

Ways that null can be rejected without coupling between the channels.

Type:

tuple of str

generator#

name, null and params of the surrogate generator.

Type:

dict

n_surrogates, seed, alpha

How the test was run. alpha only enters the power check.

checks#

Diagnostics of the test itself: surrogate_power, surrogate_generation and surrogate_fits.

Type:

AssumptionChecklist

__init__(observed: Connectivity, pvalues: ndarray, effect: ndarray, zscore: ndarray, null: str, limitations: tuple[str, ...], generator: dict[str, Any], n_surrogates: int, seed: int, alpha: float, checks: AssumptionChecklist) → None#

Methods

__init__(observed, pvalues, effect, zscore, ...)

adjusted([method])

Return the p-values adjusted over the family (see adjust_pvalues()).

significant([alpha, method])

Return a boolean mask of the cells that survive correction.

Attributes

antisymmetric

Whether the tested method is antisymmetric (MethodInfo.antisymmetric).

defined

Boolean mask of the cells that have a p-value.

method

Name of the estimator that was tested.

observed

pvalues

effect

zscore

null

limitations

generator

n_surrogates

seed

alpha

checks