__init__.py 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380
  1. """
  2. ==========================================
  3. Statistical functions (:mod:`scipy.stats`)
  4. ==========================================
  5. .. module:: scipy.stats
  6. This module contains a large number of probability distributions as
  7. well as a growing library of statistical functions.
  8. Each univariate distribution is an instance of a subclass of `rv_continuous`
  9. (`rv_discrete` for discrete distributions):
  10. .. autosummary::
  11. :toctree: generated/
  12. rv_continuous
  13. rv_discrete
  14. rv_histogram
  15. Continuous distributions
  16. ========================
  17. .. autosummary::
  18. :toctree: generated/
  19. alpha -- Alpha
  20. anglit -- Anglit
  21. arcsine -- Arcsine
  22. argus -- Argus
  23. beta -- Beta
  24. betaprime -- Beta Prime
  25. bradford -- Bradford
  26. burr -- Burr (Type III)
  27. burr12 -- Burr (Type XII)
  28. cauchy -- Cauchy
  29. chi -- Chi
  30. chi2 -- Chi-squared
  31. cosine -- Cosine
  32. crystalball -- Crystalball
  33. dgamma -- Double Gamma
  34. dweibull -- Double Weibull
  35. erlang -- Erlang
  36. expon -- Exponential
  37. exponnorm -- Exponentially Modified Normal
  38. exponweib -- Exponentiated Weibull
  39. exponpow -- Exponential Power
  40. f -- F (Snecdor F)
  41. fatiguelife -- Fatigue Life (Birnbaum-Saunders)
  42. fisk -- Fisk
  43. foldcauchy -- Folded Cauchy
  44. foldnorm -- Folded Normal
  45. frechet_r -- Deprecated. Alias for weibull_min
  46. frechet_l -- Deprecated. Alias for weibull_max
  47. genlogistic -- Generalized Logistic
  48. gennorm -- Generalized normal
  49. genpareto -- Generalized Pareto
  50. genexpon -- Generalized Exponential
  51. genextreme -- Generalized Extreme Value
  52. gausshyper -- Gauss Hypergeometric
  53. gamma -- Gamma
  54. gengamma -- Generalized gamma
  55. genhalflogistic -- Generalized Half Logistic
  56. gilbrat -- Gilbrat
  57. gompertz -- Gompertz (Truncated Gumbel)
  58. gumbel_r -- Right Sided Gumbel, Log-Weibull, Fisher-Tippett, Extreme Value Type I
  59. gumbel_l -- Left Sided Gumbel, etc.
  60. halfcauchy -- Half Cauchy
  61. halflogistic -- Half Logistic
  62. halfnorm -- Half Normal
  63. halfgennorm -- Generalized Half Normal
  64. hypsecant -- Hyperbolic Secant
  65. invgamma -- Inverse Gamma
  66. invgauss -- Inverse Gaussian
  67. invweibull -- Inverse Weibull
  68. johnsonsb -- Johnson SB
  69. johnsonsu -- Johnson SU
  70. kappa4 -- Kappa 4 parameter
  71. kappa3 -- Kappa 3 parameter
  72. ksone -- Kolmogorov-Smirnov one-sided (no stats)
  73. kstwobign -- Kolmogorov-Smirnov two-sided test for Large N (no stats)
  74. laplace -- Laplace
  75. levy -- Levy
  76. levy_l
  77. levy_stable
  78. logistic -- Logistic
  79. loggamma -- Log-Gamma
  80. loglaplace -- Log-Laplace (Log Double Exponential)
  81. lognorm -- Log-Normal
  82. lomax -- Lomax (Pareto of the second kind)
  83. maxwell -- Maxwell
  84. mielke -- Mielke's Beta-Kappa
  85. moyal -- Moyal
  86. nakagami -- Nakagami
  87. ncx2 -- Non-central chi-squared
  88. ncf -- Non-central F
  89. nct -- Non-central Student's T
  90. norm -- Normal (Gaussian)
  91. norminvgauss -- Normal Inverse Gaussian
  92. pareto -- Pareto
  93. pearson3 -- Pearson type III
  94. powerlaw -- Power-function
  95. powerlognorm -- Power log normal
  96. powernorm -- Power normal
  97. rdist -- R-distribution
  98. reciprocal -- Reciprocal
  99. rayleigh -- Rayleigh
  100. rice -- Rice
  101. recipinvgauss -- Reciprocal Inverse Gaussian
  102. semicircular -- Semicircular
  103. skewnorm -- Skew normal
  104. t -- Student's T
  105. trapz -- Trapezoidal
  106. triang -- Triangular
  107. truncexpon -- Truncated Exponential
  108. truncnorm -- Truncated Normal
  109. tukeylambda -- Tukey-Lambda
  110. uniform -- Uniform
  111. vonmises -- Von-Mises (Circular)
  112. vonmises_line -- Von-Mises (Line)
  113. wald -- Wald
  114. weibull_min -- Minimum Weibull (see Frechet)
  115. weibull_max -- Maximum Weibull (see Frechet)
  116. wrapcauchy -- Wrapped Cauchy
  117. Multivariate distributions
  118. ==========================
  119. .. autosummary::
  120. :toctree: generated/
  121. multivariate_normal -- Multivariate normal distribution
  122. matrix_normal -- Matrix normal distribution
  123. dirichlet -- Dirichlet
  124. wishart -- Wishart
  125. invwishart -- Inverse Wishart
  126. multinomial -- Multinomial distribution
  127. special_ortho_group -- SO(N) group
  128. ortho_group -- O(N) group
  129. unitary_group -- U(N) group
  130. random_correlation -- random correlation matrices
  131. Discrete distributions
  132. ======================
  133. .. autosummary::
  134. :toctree: generated/
  135. bernoulli -- Bernoulli
  136. binom -- Binomial
  137. boltzmann -- Boltzmann (Truncated Discrete Exponential)
  138. dlaplace -- Discrete Laplacian
  139. geom -- Geometric
  140. hypergeom -- Hypergeometric
  141. logser -- Logarithmic (Log-Series, Series)
  142. nbinom -- Negative Binomial
  143. planck -- Planck (Discrete Exponential)
  144. poisson -- Poisson
  145. randint -- Discrete Uniform
  146. skellam -- Skellam
  147. zipf -- Zipf
  148. yulesimon -- Yule-Simon
  149. An overview of statistical functions is given below.
  150. Several of these functions have a similar version in
  151. `scipy.stats.mstats` which work for masked arrays.
  152. Summary statistics
  153. ==================
  154. .. autosummary::
  155. :toctree: generated/
  156. describe -- Descriptive statistics
  157. gmean -- Geometric mean
  158. hmean -- Harmonic mean
  159. kurtosis -- Fisher or Pearson kurtosis
  160. mode -- Modal value
  161. moment -- Central moment
  162. skew -- Skewness
  163. kstat --
  164. kstatvar --
  165. tmean -- Truncated arithmetic mean
  166. tvar -- Truncated variance
  167. tmin --
  168. tmax --
  169. tstd --
  170. tsem --
  171. variation -- Coefficient of variation
  172. find_repeats
  173. trim_mean
  174. iqr
  175. sem
  176. bayes_mvs
  177. mvsdist
  178. entropy
  179. Frequency statistics
  180. ====================
  181. .. autosummary::
  182. :toctree: generated/
  183. cumfreq
  184. itemfreq
  185. percentileofscore
  186. scoreatpercentile
  187. relfreq
  188. .. autosummary::
  189. :toctree: generated/
  190. binned_statistic -- Compute a binned statistic for a set of data.
  191. binned_statistic_2d -- Compute a 2-D binned statistic for a set of data.
  192. binned_statistic_dd -- Compute a d-D binned statistic for a set of data.
  193. Correlation functions
  194. =====================
  195. .. autosummary::
  196. :toctree: generated/
  197. f_oneway
  198. pearsonr
  199. spearmanr
  200. pointbiserialr
  201. kendalltau
  202. weightedtau
  203. linregress
  204. siegelslopes
  205. theilslopes
  206. Statistical tests
  207. =================
  208. .. autosummary::
  209. :toctree: generated/
  210. ttest_1samp
  211. ttest_ind
  212. ttest_ind_from_stats
  213. ttest_rel
  214. kstest
  215. chisquare
  216. power_divergence
  217. ks_2samp
  218. mannwhitneyu
  219. tiecorrect
  220. rankdata
  221. ranksums
  222. wilcoxon
  223. kruskal
  224. friedmanchisquare
  225. brunnermunzel
  226. combine_pvalues
  227. jarque_bera
  228. .. autosummary::
  229. :toctree: generated/
  230. ansari
  231. bartlett
  232. levene
  233. shapiro
  234. anderson
  235. anderson_ksamp
  236. binom_test
  237. fligner
  238. median_test
  239. mood
  240. skewtest
  241. kurtosistest
  242. normaltest
  243. Transformations
  244. ===============
  245. .. autosummary::
  246. :toctree: generated/
  247. boxcox
  248. boxcox_normmax
  249. boxcox_llf
  250. yeojohnson
  251. yeojohnson_normmax
  252. yeojohnson_llf
  253. obrientransform
  254. sigmaclip
  255. trimboth
  256. trim1
  257. zmap
  258. zscore
  259. Statistical distances
  260. =====================
  261. .. autosummary::
  262. :toctree: generated/
  263. wasserstein_distance
  264. energy_distance
  265. Random variate generation
  266. =========================
  267. .. autosummary::
  268. :toctree: generated/
  269. rvs_ratio_uniforms
  270. Circular statistical functions
  271. ==============================
  272. .. autosummary::
  273. :toctree: generated/
  274. circmean
  275. circvar
  276. circstd
  277. Contingency table functions
  278. ===========================
  279. .. autosummary::
  280. :toctree: generated/
  281. chi2_contingency
  282. contingency.expected_freq
  283. contingency.margins
  284. fisher_exact
  285. Plot-tests
  286. ==========
  287. .. autosummary::
  288. :toctree: generated/
  289. ppcc_max
  290. ppcc_plot
  291. probplot
  292. boxcox_normplot
  293. yeojohnson_normplot
  294. Masked statistics functions
  295. ===========================
  296. .. toctree::
  297. stats.mstats
  298. Univariate and multivariate kernel density estimation (:mod:`scipy.stats.kde`)
  299. ==============================================================================
  300. .. autosummary::
  301. :toctree: generated/
  302. gaussian_kde
  303. For many more stat related functions install the software R and the
  304. interface package rpy.
  305. """
  306. from __future__ import division, print_function, absolute_import
  307. from .stats import *
  308. from .distributions import *
  309. from .morestats import *
  310. from ._binned_statistic import *
  311. from .kde import gaussian_kde
  312. from . import mstats
  313. from .contingency import chi2_contingency
  314. from ._multivariate import *
  315. __all__ = [s for s in dir() if not s.startswith("_")] # Remove dunders.
  316. from scipy._lib._testutils import PytestTester
  317. test = PytestTester(__name__)
  318. del PytestTester