Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.8/site-packages/scipy/stats/__init__.py: 100%
26 statements
« prev ^ index » next coverage.py v7.3.2, created at 2023-12-12 06:31 +0000
« prev ^ index » next coverage.py v7.3.2, created at 2023-12-12 06:31 +0000
1"""
2.. _statsrefmanual:
4==========================================
5Statistical functions (:mod:`scipy.stats`)
6==========================================
8.. currentmodule:: scipy.stats
10This module contains a large number of probability distributions,
11summary and frequency statistics, correlation functions and statistical
12tests, masked statistics, kernel density estimation, quasi-Monte Carlo
13functionality, and more.
15Statistics is a very large area, and there are topics that are out of scope
16for SciPy and are covered by other packages. Some of the most important ones
17are:
19- `statsmodels <https://www.statsmodels.org/stable/index.html>`__:
20 regression, linear models, time series analysis, extensions to topics
21 also covered by ``scipy.stats``.
22- `Pandas <https://pandas.pydata.org/>`__: tabular data, time series
23 functionality, interfaces to other statistical languages.
24- `PyMC <https://docs.pymc.io/>`__: Bayesian statistical
25 modeling, probabilistic machine learning.
26- `scikit-learn <https://scikit-learn.org/>`__: classification, regression,
27 model selection.
28- `Seaborn <https://seaborn.pydata.org/>`__: statistical data visualization.
29- `rpy2 <https://rpy2.github.io/>`__: Python to R bridge.
32Probability distributions
33=========================
35Each univariate distribution is an instance of a subclass of `rv_continuous`
36(`rv_discrete` for discrete distributions):
38.. autosummary::
39 :toctree: generated/
41 rv_continuous
42 rv_discrete
43 rv_histogram
45Continuous distributions
46------------------------
48.. autosummary::
49 :toctree: generated/
51 alpha -- Alpha
52 anglit -- Anglit
53 arcsine -- Arcsine
54 argus -- Argus
55 beta -- Beta
56 betaprime -- Beta Prime
57 bradford -- Bradford
58 burr -- Burr (Type III)
59 burr12 -- Burr (Type XII)
60 cauchy -- Cauchy
61 chi -- Chi
62 chi2 -- Chi-squared
63 cosine -- Cosine
64 crystalball -- Crystalball
65 dgamma -- Double Gamma
66 dweibull -- Double Weibull
67 erlang -- Erlang
68 expon -- Exponential
69 exponnorm -- Exponentially Modified Normal
70 exponweib -- Exponentiated Weibull
71 exponpow -- Exponential Power
72 f -- F (Snecdor F)
73 fatiguelife -- Fatigue Life (Birnbaum-Saunders)
74 fisk -- Fisk
75 foldcauchy -- Folded Cauchy
76 foldnorm -- Folded Normal
77 genlogistic -- Generalized Logistic
78 gennorm -- Generalized normal
79 genpareto -- Generalized Pareto
80 genexpon -- Generalized Exponential
81 genextreme -- Generalized Extreme Value
82 gausshyper -- Gauss Hypergeometric
83 gamma -- Gamma
84 gengamma -- Generalized gamma
85 genhalflogistic -- Generalized Half Logistic
86 genhyperbolic -- Generalized Hyperbolic
87 geninvgauss -- Generalized Inverse Gaussian
88 gibrat -- Gibrat
89 gilbrat -- Gilbrat
90 gompertz -- Gompertz (Truncated Gumbel)
91 gumbel_r -- Right Sided Gumbel, Log-Weibull, Fisher-Tippett, Extreme Value Type I
92 gumbel_l -- Left Sided Gumbel, etc.
93 halfcauchy -- Half Cauchy
94 halflogistic -- Half Logistic
95 halfnorm -- Half Normal
96 halfgennorm -- Generalized Half Normal
97 hypsecant -- Hyperbolic Secant
98 invgamma -- Inverse Gamma
99 invgauss -- Inverse Gaussian
100 invweibull -- Inverse Weibull
101 johnsonsb -- Johnson SB
102 johnsonsu -- Johnson SU
103 kappa4 -- Kappa 4 parameter
104 kappa3 -- Kappa 3 parameter
105 ksone -- Distribution of Kolmogorov-Smirnov one-sided test statistic
106 kstwo -- Distribution of Kolmogorov-Smirnov two-sided test statistic
107 kstwobign -- Limiting Distribution of scaled Kolmogorov-Smirnov two-sided test statistic.
108 laplace -- Laplace
109 laplace_asymmetric -- Asymmetric Laplace
110 levy -- Levy
111 levy_l
112 levy_stable
113 logistic -- Logistic
114 loggamma -- Log-Gamma
115 loglaplace -- Log-Laplace (Log Double Exponential)
116 lognorm -- Log-Normal
117 loguniform -- Log-Uniform
118 lomax -- Lomax (Pareto of the second kind)
119 maxwell -- Maxwell
120 mielke -- Mielke's Beta-Kappa
121 moyal -- Moyal
122 nakagami -- Nakagami
123 ncx2 -- Non-central chi-squared
124 ncf -- Non-central F
125 nct -- Non-central Student's T
126 norm -- Normal (Gaussian)
127 norminvgauss -- Normal Inverse Gaussian
128 pareto -- Pareto
129 pearson3 -- Pearson type III
130 powerlaw -- Power-function
131 powerlognorm -- Power log normal
132 powernorm -- Power normal
133 rdist -- R-distribution
134 rayleigh -- Rayleigh
135 rice -- Rice
136 recipinvgauss -- Reciprocal Inverse Gaussian
137 semicircular -- Semicircular
138 skewcauchy -- Skew Cauchy
139 skewnorm -- Skew normal
140 studentized_range -- Studentized Range
141 t -- Student's T
142 trapezoid -- Trapezoidal
143 triang -- Triangular
144 truncexpon -- Truncated Exponential
145 truncnorm -- Truncated Normal
146 truncpareto -- Truncated Pareto
147 truncweibull_min -- Truncated minimum Weibull distribution
148 tukeylambda -- Tukey-Lambda
149 uniform -- Uniform
150 vonmises -- Von-Mises (Circular)
151 vonmises_line -- Von-Mises (Line)
152 wald -- Wald
153 weibull_min -- Minimum Weibull (see Frechet)
154 weibull_max -- Maximum Weibull (see Frechet)
155 wrapcauchy -- Wrapped Cauchy
157Multivariate distributions
158--------------------------
160.. autosummary::
161 :toctree: generated/
163 multivariate_normal -- Multivariate normal distribution
164 matrix_normal -- Matrix normal distribution
165 dirichlet -- Dirichlet
166 wishart -- Wishart
167 invwishart -- Inverse Wishart
168 multinomial -- Multinomial distribution
169 special_ortho_group -- SO(N) group
170 ortho_group -- O(N) group
171 unitary_group -- U(N) group
172 random_correlation -- random correlation matrices
173 multivariate_t -- Multivariate t-distribution
174 multivariate_hypergeom -- Multivariate hypergeometric distribution
175 random_table -- Distribution of random tables with given marginals
176 uniform_direction -- Uniform distribution on S(N-1)
178`scipy.stats.multivariate_normal` methods accept instances
179of the following class to represent the covariance.
181.. autosummary::
182 :toctree: generated/
184 Covariance -- Representation of a covariance matrix
187Discrete distributions
188----------------------
190.. autosummary::
191 :toctree: generated/
193 bernoulli -- Bernoulli
194 betabinom -- Beta-Binomial
195 binom -- Binomial
196 boltzmann -- Boltzmann (Truncated Discrete Exponential)
197 dlaplace -- Discrete Laplacian
198 geom -- Geometric
199 hypergeom -- Hypergeometric
200 logser -- Logarithmic (Log-Series, Series)
201 nbinom -- Negative Binomial
202 nchypergeom_fisher -- Fisher's Noncentral Hypergeometric
203 nchypergeom_wallenius -- Wallenius's Noncentral Hypergeometric
204 nhypergeom -- Negative Hypergeometric
205 planck -- Planck (Discrete Exponential)
206 poisson -- Poisson
207 randint -- Discrete Uniform
208 skellam -- Skellam
209 yulesimon -- Yule-Simon
210 zipf -- Zipf (Zeta)
211 zipfian -- Zipfian
213An overview of statistical functions is given below. Many of these functions
214have a similar version in `scipy.stats.mstats` which work for masked arrays.
216Summary statistics
217==================
219.. autosummary::
220 :toctree: generated/
222 describe -- Descriptive statistics
223 gmean -- Geometric mean
224 hmean -- Harmonic mean
225 pmean -- Power mean
226 kurtosis -- Fisher or Pearson kurtosis
227 mode -- Modal value
228 moment -- Central moment
229 expectile -- Expectile
230 skew -- Skewness
231 kstat --
232 kstatvar --
233 tmean -- Truncated arithmetic mean
234 tvar -- Truncated variance
235 tmin --
236 tmax --
237 tstd --
238 tsem --
239 variation -- Coefficient of variation
240 find_repeats
241 trim_mean
242 gstd -- Geometric Standard Deviation
243 iqr
244 sem
245 bayes_mvs
246 mvsdist
247 entropy
248 differential_entropy
249 median_abs_deviation
251Frequency statistics
252====================
254.. autosummary::
255 :toctree: generated/
257 cumfreq
258 percentileofscore
259 scoreatpercentile
260 relfreq
262.. autosummary::
263 :toctree: generated/
265 binned_statistic -- Compute a binned statistic for a set of data.
266 binned_statistic_2d -- Compute a 2-D binned statistic for a set of data.
267 binned_statistic_dd -- Compute a d-D binned statistic for a set of data.
269Correlation functions
270=====================
272.. autosummary::
273 :toctree: generated/
275 f_oneway
276 alexandergovern
277 pearsonr
278 spearmanr
279 pointbiserialr
280 kendalltau
281 weightedtau
282 somersd
283 linregress
284 siegelslopes
285 theilslopes
286 multiscale_graphcorr
288Statistical tests
289=================
291.. autosummary::
292 :toctree: generated/
294 ttest_1samp
295 ttest_ind
296 ttest_ind_from_stats
297 ttest_rel
298 chisquare
299 cramervonmises
300 cramervonmises_2samp
301 power_divergence
302 kstest
303 ks_1samp
304 ks_2samp
305 epps_singleton_2samp
306 mannwhitneyu
307 tiecorrect
308 rankdata
309 ranksums
310 wilcoxon
311 kruskal
312 friedmanchisquare
313 brunnermunzel
314 combine_pvalues
315 jarque_bera
316 page_trend_test
317 tukey_hsd
318 poisson_means_test
320.. autosummary::
321 :toctree: generated/
323 ansari
324 bartlett
325 levene
326 shapiro
327 anderson
328 anderson_ksamp
329 binom_test
330 binomtest
331 fligner
332 median_test
333 mood
334 skewtest
335 kurtosistest
336 normaltest
337 goodness_of_fit
340Quasi-Monte Carlo
341=================
343.. toctree::
344 :maxdepth: 4
346 stats.qmc
348Resampling Methods
349==================
351.. autosummary::
352 :toctree: generated/
354 bootstrap
355 permutation_test
356 monte_carlo_test
358Masked statistics functions
359===========================
361.. toctree::
363 stats.mstats
366Other statistical functionality
367===============================
369Transformations
370---------------
372.. autosummary::
373 :toctree: generated/
375 boxcox
376 boxcox_normmax
377 boxcox_llf
378 yeojohnson
379 yeojohnson_normmax
380 yeojohnson_llf
381 obrientransform
382 sigmaclip
383 trimboth
384 trim1
385 zmap
386 zscore
387 gzscore
389Statistical distances
390---------------------
392.. autosummary::
393 :toctree: generated/
395 wasserstein_distance
396 energy_distance
398Sampling
399--------
401.. toctree::
402 :maxdepth: 4
404 stats.sampling
406Random variate generation / CDF Inversion
407-----------------------------------------
409.. autosummary::
410 :toctree: generated/
412 rvs_ratio_uniforms
414Distribution Fitting
415--------------------
417.. autosummary::
418 :toctree: generated/
420 fit
422Directional statistical functions
423---------------------------------
425.. autosummary::
426 :toctree: generated/
428 directional_stats
429 circmean
430 circvar
431 circstd
433Contingency table functions
434---------------------------
436.. autosummary::
437 :toctree: generated/
439 chi2_contingency
440 contingency.crosstab
441 contingency.expected_freq
442 contingency.margins
443 contingency.relative_risk
444 contingency.association
445 contingency.odds_ratio
446 fisher_exact
447 barnard_exact
448 boschloo_exact
450Plot-tests
451----------
453.. autosummary::
454 :toctree: generated/
456 ppcc_max
457 ppcc_plot
458 probplot
459 boxcox_normplot
460 yeojohnson_normplot
462Univariate and multivariate kernel density estimation
463-----------------------------------------------------
465.. autosummary::
466 :toctree: generated/
468 gaussian_kde
470Warnings / Errors used in :mod:`scipy.stats`
471--------------------------------------------
473.. autosummary::
474 :toctree: generated/
476 DegenerateDataWarning
477 ConstantInputWarning
478 NearConstantInputWarning
479 FitError
481"""
483from ._warnings_errors import (ConstantInputWarning, NearConstantInputWarning,
484 DegenerateDataWarning, FitError)
485from ._stats_py import *
486from ._variation import variation
487from .distributions import *
488from ._morestats import *
489from ._binomtest import binomtest
490from ._binned_statistic import *
491from ._kde import gaussian_kde
492from . import mstats
493from . import qmc
494from ._multivariate import *
495from . import contingency
496from .contingency import chi2_contingency
497from ._resampling import bootstrap, monte_carlo_test, permutation_test
498from ._entropy import *
499from ._hypotests import *
500from ._rvs_sampling import rvs_ratio_uniforms
501from ._page_trend_test import page_trend_test
502from ._mannwhitneyu import mannwhitneyu
503from ._fit import fit, goodness_of_fit
504from ._covariance import Covariance
506# Deprecated namespaces, to be removed in v2.0.0
507from . import (
508 biasedurn, kde, morestats, mstats_basic, mstats_extras, mvn, statlib, stats
509)
511__all__ = [s for s in dir() if not s.startswith("_")] # Remove dunders.
513from scipy._lib._testutils import PytestTester
514test = PytestTester(__name__)
515del PytestTester