General statistical tests that operate on population samples, such as
the binomial test, sign test, and Wilcoxon signed rank test. Also,
contains relevant CDF, PMF, and PDF functions for related distributions
such as the binomial and normal distributions.
Note: If available, SciPy's optimized versions of binomial testing and
normal CDF calculations are utilized by default. These should be
marginally faster, as they have hooks into C code.
Author: Benjamin D. Nye License: Apache License V2.0
tuple of (int or float, int or float)
|
absAndValKey(x)
Return the absolute value and the value of a number |
|
|
float
|
binomialCDF(x,
n,
p)
Binomial CDF, using log-gamma implementation |
|
|
bool
|
|
float
|
binomialPMF(x,
n,
p)
Binomial PMF, using log-gamma implementation |
|
|
float
|
binomialTest(x,
n,
p=0.5,
alternative=' two.sided ' )
Wrapper for the SciPy binomial two-sided test and binomial CDF
calculations for one-tailed tests. |
|
|
|
genericSymmetricPairedTest(statistic,
statisticAlternative,
alternative,
*args,
**kwds)
Generic symmetric paired test, to convert between different-sided
results |
|
|
float
|
permutationMeanTest(x,
y,
alternative=' two.sided ' ,
pValue=0.99,
iterations=100000,
useStoppingRule=True,
maxExactN=7)
Permutation test that tests for differences in the means of two
samples (e.g., a two-sample t-like statistic of mean(s1)-mean(s2)). |
|
|
float
|
permutationRankTest(x,
y,
alternative=' two.sided ' ,
pValue=0.99,
iterations=100000,
useStoppingRule=True,
maxExactN=7)
Permutation test that tests for differences in the ranks of two
samples. |
|
|
float
|
permutationTest(x,
y,
funct,
alternative=' two.sided ' )
A generic permutation hypothesis test between two sample populations. |
|
|
float
|
pythonBinomialTest(x,
n,
p=0.5,
alternative=' two.sided ' ,
useMinlike=True)
Exact binomial test, where two-sided test uses a minlike formulation. |
|
|
float
|
pythonNormalCDF(x,
loc=0.0,
scale=1.0)
Normal CDF (Phi) implementation based on the error function in Python
2.7 |
|
|
float
|
pythonSignTestStatistic(series,
series2=None,
mu=0.0,
alternative=' two.sided ' )
A sign test, which works based on the counts that are greater or less
than the compared pairs or null hypothesis mean. |
|
|
float, float
|
|
float
|
scipyBinomialTestStatistic(x,
n,
p=0.5,
alternative=' two.sided ' )
Wrapper for the SciPy binomial two-sided test and binomial CDF
calculations for one-tailed tests. |
|
|
float, float
|
|
float
|
signTest(series,
series2=None,
mu=0.0,
alternative=' two.sided ' )
A sign test, which works based on the counts that are greater or less
than the compared pairs or null hypothesis mean. |
|
|
float
|
transformSymmetricPValueHypothesis(statisticVal,
pValue,
originalAlternative,
newAlternative)
Transform a probability of one hypothesis into another hypothesis,
assuming a symmetric distribution (such as a normal distribution). |
|
|
float, float
|
wilcoxonMeanScore(series,
series2=None,
mu=0.0)
Get the mean Wilcoxon score, given equality |
|
|
float, float
|
|
float
|
wilcoxonSignedRankTest(x,
y=None,
mu=0.0,
alternative=' two.sided ' )
A Wilcoxon Signed Rank test, for distributions symmetric around the
median |
|
|