15.12.2012 Views

scipy tutorial - Baustatik-Info-Server

scipy tutorial - Baustatik-Info-Server

scipy tutorial - Baustatik-Info-Server

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

SciPy Reference Guide, Release 0.8.dev<br />

Notes<br />

expected frequencies in each category. By default the categories are assumed to be<br />

equally likely.<br />

ddof : int, optional<br />

adjustment to the degrees of freedom for the p-value<br />

Returns<br />

chisquare statistic : float<br />

p : float<br />

The chisquare test statistic<br />

The p-value of the test.<br />

This test is invalid when the observed or expected frequencies in each category are too small. A typical rule<br />

is that all of the observed and expected frequencies should be at least 5. The default degrees of freedom,<br />

k-1, are for the case when no parameters of the distribution are estimated. If p parameters are estimated by<br />

efficient maximum likelihood then the correct degrees of freedom are k-1-p. If the parameters are estimated in<br />

a different way, then then the dof can be between k-1-p and k-1. However, it is also possible that the asymptotic<br />

distributions is not a chisquare, in which case this test is notappropriate.<br />

References<br />

[R16]<br />

ks_2samp(data1, data2)<br />

Computes the Kolmogorov-Smirnof statistic on 2 samples.<br />

This is a two-sided test for the null hypothesis that 2 independent samples are drawn from the same continuous<br />

distribution.<br />

Notes<br />

Parameters<br />

a, b : sequence of 1-D ndarrays<br />

Returns<br />

D : float<br />

two arrays of sample observations assumed to be drawn from a continuous distribution,<br />

sample sizes can be different<br />

KS statistic<br />

p-value : float<br />

two-tailed p-value<br />

This tests whether 2 samples are drawn from the same distribution. Note that, like in the case of the one-sample<br />

K-S test, the distribution is assumed to be continuous.<br />

This is the two-sided test, one-sided tests are not implemented. The test uses the two-sided asymptotic<br />

Kolmogorov-Smirnov distribution.<br />

If the K-S statistic is small or the p-value is high, then we cannot reject the hypothesis that the distributions of<br />

the two samples are the same.<br />

660 Chapter 3. Reference

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!