API Documentation Generated by Endo, 2006-08-14
Anderson and Darling test for normal, exponential, or Gumbel (Extreme Value Type I) distribution.
Given samples x, return A2, the Anderson-Darling statistic, the significance levels in percentages, and the corresponding critical values.
Critical values provided are for the following significance levels norm/expon: 15%, 10%, 5%, 2.5%, 1% Gumbel: 25%, 10%, 5%, 2.5%, 1% logistic: 25%, 10%, 5%, 2.5%, 1%, 0.5%
If A2 is larger than these critical values then for that significance level, the hypothesis that the data come from a normal (exponential) can be rejected.
Determine if the scale parameter for two distributions with equal medians is the same using the Ansari-Bradley statistic.
Specifically, compute the AB statistic and the probability of error that the null hypothesis is true but rejected with the computed statistic as the critical value.
One can reject the null hypothesis that the ratio of variances is 1 if returned probability of error is small (say < 0.05)
Perform Bartlett test with the null hypothesis that all input samples
have equal variances.
Inputs are sample vectors: bartlett(x,y,z,...)
Outputs: (T, pval)
T -- the Test statistic
pval -- significance level if null is rejected with this value of T
(prob. that null is true but rejected with this p-value.)
Sensitive to departures from normality. The Levene test is
an alternative that is less sensitive to departures from
normality.
References:
http://www.itl.nist.gov/div898/handbook/eda/section3/eda357.htm
Snedecor, George W. and Cochran, William G. (1989), Statistical
Methods, Eighth Edition, Iowa State University Press.
Return Bayesian confidence intervals for the mean, var, and std.
Assumes 1-d data all has same mean and variance and uses Jeffrey's prior for variance and std.
alpha gives the probability that the returned interval contains the true parameter.
Uses peak of conditional pdf as starting center.
Returns (peak, (a, b)) for each of mean, variance and standard deviation.
An exact (two-sided) test of the null hypothesis that the
probability of success in a Bernoulli experiment is p.
Inputs:
x -- Number of successes (or a vector of length 2 giving the
number of successes and number of failures respectively)
n -- Number of trials (ignored if x has length 2)
p -- Hypothesized probability of success
Returns pval -- Probability that null test is rejected for this set
of x and n even though it is true.
Return a positive dataset tranformed by a Box-Cox power transformation.
If lmbda is not None, do the transformation for that value.
If lmbda is None, find the lambda that maximizes the log-likelihood function and return it as the second output argument.
If alpha is not None, return the 100(1-alpha)% confidence interval for lambda as the third output argument.
The boxcox log-likelihood function.
Compute the circular mean for samples assumed to be in the range [low to high]
Compute the circular standard deviation for samples assumed to be in the range [low to high]
Compute the circular variance for samples assumed to be in the range [low to high]
Find repeats in arr and return (repeats, repeat_count)
Perform Levene test with the null hypothesis that all input samples
have equal variances.
Inputs are sample vectors: bartlett(x,y,z,...)
One keyword input, center, can be used with values
center = 'mean', center='median' (default), center='trimmed'
Outputs: (Xsq, pval)
Xsq -- the Test statistic
pval -- significance level if null is rejected with this value of X
(prob. that null is true but rejected with this p-value.)
References:
http://www.stat.psu.edu/~bgl/center/tr/TR993.ps
Fligner, M.A. and Killeen, T.J. (1976). Distribution-free two-sample
tests for scale. 'Journal of the American Statistical Association.'
71(353), 210-213.
Return the nth k-statistic (1<=n<=4 so far).
The nth k-statistic is the unique symmetric unbiased estimator of the nth cumulant kappa_n
Returns an unbiased estimator of the variance of the k-statistic: n=1 or 2
Perform Levene test with the null hypothesis that all input samples
have equal variances.
Inputs are sample vectors: bartlett(x,y,z,...)
One keyword input, center, can be used with values
center = 'mean', center='median' (default), center='trimmed'
center='median' is recommended for skewed (non-normal) distributions
center='mean' is recommended for symmetric, moderate-tailed, dist.
center='trimmed' is recommended for heavy-tailed distributions.
Outputs: (W, pval)
W -- the Test statistic
pval -- significance level if null is rejected with this value of W
(prob. that null is true but rejected with this p-value.)
References:
http://www.itl.nist.gov/div898/handbook/eda/section3/eda35a.htm
Levene, H. (1960). In Contributions to Probability and Statistics:
Essays in Honor of Harold Hotelling, I. Olkin et al. eds.,
Stanford University Press, pp. 278-292.
Brown, M. B. and Forsythe, A. B. (1974), Journal of the American
Statistical Association, 69, 364-367
Determine if the scale parameter for two distributions with equal medians is the same using a Mood test.
Specifically, compute the z statistic and the probability of error that the null hypothesis is true but rejected with the computed statistic as the critical value.
One can reject the null hypothesis that the ratio of scale parameters is 1 if the returned probability of error is small (say < 0.05)
Test for equal means in two or more samples from the normal distribution.
If the keyword parameter <equal_var> is true then the variances are assumed to be equal, otherwise they are not assumed to be equal (default).
Return test statistic and the p-value giving the probability of error if the null hypothesis (equal means) is rejected at this value.
Return the Gaussian expanded pdf function given the list of central moments (first one is mean).
Return a function that approximates the pdf of a set of samples using a Gaussian expansion computed from the mean, variance, skewness and Fisher's kurtosis.
Returns the shape parameter that maximizes the probability plot correlation coefficient for the given data to a one-parameter family of distributions.
See also ppcc_plot
Returns (shape, ppcc), and optionally plots shape vs. ppcc (probability plot correlation coefficient) as a function of shape parameter for a one-parameter family of distributions from shape value a to b.
See also ppcc_max
Return (osm, osr){,(scale,loc,r)} where (osm, osr) are order statistic medians and ordered response data respectively so that plot(osm, osr) is a probability plot. If fit==1, then do a regression fit and compute the slope (scale), intercept (loc), and correlation coefficient (r), of the best straight line through the points. If fit==0, only (osm, osr) is returned.
sparams is a tuple of shape parameter arguments for the distribution.
Shapiro and Wilk test for normality.
Given random variates x, compute the W statistic and its p-value for a normality test.
If p-value is high, one cannot reject the null hypothesis of normality with this test. P-value is probability that the W statistic is as low as it is if the samples are actually from a normal distribution.
Output: W statistic and its p-value
- if reta is nonzero then also return the computed "a" values
- as the third output. If these are known for a given size they can be given as input instead of computed internally.
Calculates the Wilcoxon signed-rank test for the null hypothesis that two samples come from the same distribution. A non-parametric T-test. (need N > 20)
Returns: t-statistic, two-tailed p-value
| Local name | Refers to |
|---|---|
| amax | numpy.amax |
| amin | numpy.amin |
| angle | numpy.angle |
| any | numpy.any |
| arange | numpy.arange |
| around | numpy.around |
| array | numpy.array |
| asarray | numpy.asarray |
| atleast_1d | numpy.atleast_1d |
| ceil | numpy.ceil |
| compress | numpy.compress |
| distributions | scipy.stats.distributions |
| exp | numpy.exp |
| floor | numpy.floor |
| futil | futil |
| inspect | inspect |
| isscalar | numpy.isscalar |
| log | numpy.log |
| math | math |
| nested_scopes | __future__.nested_scopes |
| not_equal | numpy.not_equal |
| numpy | numpy |
| optimize | scipy.optimize |
| pi | numpy.pi |
| poly1d | numpy.poly1d |
| ravel | numpy.ravel |
| r_ | numpy.r_ |
| sb | numpy |
| scipy | scipy |
| sort | numpy.sort |
| sqrt | numpy.sqrt |
| statlib | statlib |
| stats | scipy.stats.stats |
| sum | numpy.sum |
| types | types |
| unique | numpy.unique |
| where | numpy.where |
| zeros | numpy.zeros |