phitter.continuous.continuous_statistical_tests package
Submodules
phitter.continuous.continuous_statistical_tests.continuous_test_anderson_darling module
- phitter.continuous.continuous_statistical_tests.continuous_test_anderson_darling.evaluate_continuous_test_anderson_darling(distribution, continuous_measures)
Anderson Darling test to evaluate that a sample is distributed according to a probability distribution.
The hypothesis that the sample is distributed following the probability distribution is not rejected if the test statistic is less than the critical value or equivalently if the p-value is less than 0.05
- Parameters:
data (iterable) – data set
distribution (class) – distribution class initialized whit parameters of distribution and methods cdf() and num_parameters()
- Returns:
result_test_ks –
- test_statistic(float):
sum over all data(Y) of the value ((2k - 1) / N) * (ln[Fn(Y[k])] + ln[1 - Fn(Y[N - k + 1])]).
- critical_value(float):
calculation of the Anderson Darling critical value using Marsaglia - Marsaglia function. whit size of sample N as parameter.
- p-value[0,1]:
probability of the test statistic for the Anderson - Darling distribution whit size of sample N as parameter.
- rejected(bool):
decision if the null hypothesis is rejected. If it is false, it can be considered that the sample is distributed according to the probability distribution. If it’s true, no.
- Return type:
dict
References
phitter.continuous.continuous_statistical_tests.continuous_test_chi_square module
- phitter.continuous.continuous_statistical_tests.continuous_test_chi_square.evaluate_continuous_test_chi_square(distribution, continuous_measures)
Chi Square test to evaluate that a sample is distributed according to a probability distribution.
The hypothesis that the sample is distributed following the probability distribution is not rejected if the test statistic is less than the critical value or equivalently if the p-value is less than 0.05
- Parameters:
data (iterable) – data set
distribution (class) – distribution class initialized whit parameters of distribution and methods cdf() and num_parameters()
- Returns:
result_test_chi2 –
- test_statistic(float):
sum over all classes of the value (expected - observed) ^ 2 / expected
- critical_value(float):
inverse of the distribution chi square to 0.95 with freedom degrees n - 1 minus the number of parameters of the distribution.
- p-value([0,1]):
right - tailed probability of the test statistic for the chi - square distribution with the same degrees of freedom as for the critical value calculation.
- rejected(bool):
decision if the null hypothesis is rejected. If it is false, it can be considered that the sample is distributed according to the probability distribution. If it’s true, no.
- Return type:
dict
phitter.continuous.continuous_statistical_tests.continuous_test_kolmogorov_smirnov module
- phitter.continuous.continuous_statistical_tests.continuous_test_kolmogorov_smirnov.evaluate_continuous_test_kolmogorov_smirnov(distribution, continuous_measures)
Kolmogorov Smirnov test to evaluate that a sample is distributed according to a probability distribution.
The hypothesis that the sample is distributed following the probability distribution is not rejected if the test statistic is less than the critical value or equivalently if the p-value is less than 0.05
- Parameters:
data (iterable) – data set
distribution (class) – distribution class initialized whit parameters of distribution and methods cdf() and num_parameters()
- Returns:
result_test_ks –
- test_statistic(float):
sum over all data of the value |Sn - Fn|
- critical_value(float):
inverse of the kolmogorov - smirnov distribution to 0.95 whit size of sample N as parameter.
- p-value[0,1]:
probability of the test statistic for the kolmogorov - smirnov distribution whit size of sample N as parameter.
- rejected(bool):
decision if the null hypothesis is rejected. If it is false, it can be considered that the sample is distributed according to the probability distribution. If it’s true, no.
- Return type:
dict