plans.stochastic.normality#
Statistical tests for distribution assumptions.
Functions
|
Get normality analysis using standard tests. |
|
Util function for statistical testing |
|
Test for normality using the D'Agostino-Pearson test. |
|
Test for normality using the Kolmogorov-Smirnov test |
|
Test for normality using the Shapiro-Wilk test. |
- plans.stochastic.normality.test_distribution(test_name, stat, p, clevel=0.95, distr='normal')[source]#
Util function for statistical testing
The distribution is accepted when \(p > 1 - c\), at confidence level \(c\).
- Parameters:
test_name (str) – name of test
stat (float) – statistic
p (float) – p-value
clevel (float) – confidence level
distr (str) – name of distribution
- Returns:
summary of test
- Return type:
dict
- plans.stochastic.normality.test_normality_ks(data, clevel=0.95)[source]#
Test for normality using the Kolmogorov-Smirnov test
Kolmogorov-Smirnov Test: This test compares the observed distribution with the expected normal distribution using a test statistic and a p-value. A p-value less than 0.05 indicates that the null hypothesis should be rejected.
The sample is first standardized as \(z_i = (x_i - \bar{x}) / s\).
- Parameters:
data (
numpy.ndarray) – vector of data without nan valuesclevel (float) – confidence level
- Returns:
test result dictionary. Keys: Statistic, p-value and Is normal
- Return type:
dict
- plans.stochastic.normality.test_normality_sw(data, clevel=0.95)[source]#
Test for normality using the Shapiro-Wilk test.
- Parameters:
data (
numpy.ndarray) – vector of data without nan valuesclevel (float) – confidence level
- Returns:
test result dictionary. Keys: Statistic, p-value and Is normal
- Return type:
dict
- plans.stochastic.normality.test_normality_dp(data, clevel=0.95)[source]#
Test for normality using the D’Agostino-Pearson test.
- Parameters:
data (
numpy.ndarray) – vector of data without nan valuesclevel (float) – confidence level
- Returns:
test result dictionary. Keys: Statistic, p-value and Is normal
- Return type:
dict