bundles / scipy 1.17.1 / scipy / stats / _mgc / _perm_test
function
scipy.stats._mgc:_perm_test
source: /scipy/stats/_mgc.py :36
Signature
def _perm_test ( x , y , stat , reps = 1000 , workers = -1 , random_state = None ) Summary
Helper function that calculates the p-value. See below for uses.
Parameters
x, y: ndarrayxandyhave shapes(n, p)and(n, q).stat: floatThe sample test statistic.
reps: int, optionalThe number of replications used to estimate the null when using the permutation test. The default is 1000 replications.
workers: int or map-like callable, optionalIf
workersis an int the population is subdivided intoworkerssections and evaluated in parallel (usesmultiprocessing.Pool <multiprocessing>). Supply-1to use all cores available to the Process. Alternatively supply a map-like callable, such asmultiprocessing.Pool.mapfor evaluating the population in parallel. This evaluation is carried out asworkers(func, iterable). Requires thatfuncbe pickleable.random_state: {None, int, `numpy.random.Generator`,numpy.random.RandomState}, optional
If
seedis None (ornp.random), the numpy.random.RandomState singleton is used. Ifseedis an int, a newRandomStateinstance is used, seeded withseed. Ifseedis already aGeneratororRandomStateinstance then that instance is used.
Returns
pvalue: floatThe sample test p-value.
null_dist: listThe approximated null distribution.
Aliases
-
scipy.stats._mgc._perm_test