fi_test#
- normtest.filliben.fi_test(x_data, alpha=0.05)[source]#
This function applies the Filliben Normality test [1].
- Parameters:
- x_datanumpy array
One dimension numpy array with at least
4observations.- alphafloat, optional
The level of significance (\(\alpha\)). Default is
0.05;
- Returns:
- resulttuple with
- statisticfloat (positive)
The test statistic;
- criticalfloat
The critical value of the test;
- p_valuefloat or str
The probability of the test;
- conclusionstr
The test conclusion (e.g, Normal/Not Normal).
Notes
The test statistic (\(F_{p}\)) is estimated through the correlation between the ordered data and the Normal statistical order:
\[F_p = \frac{\sum_{i=1}^n \left(x_i - \overline{x}\right) \left(z_i - \overline{z}\right)}{\sqrt{\sum_{i=1}^n \left( x_i - \overline{x}\right)^2 \sum_{i=1}^n \left( z_i - \overline{z}\right)^2}}\]where \(z_{i}\) values are the z-score values of the corresponding experimental data (\(x_{{i}}\)) value, and \(n\) is the sample size.
The correlation is estimated using scipy.stats.pearsonr().
The Normality test has the following assumptions:
☕
\(H_0:\) Data was sampled from a Normal distribution.
\(H_1:\) The data was sampled from a distribution other than the Normal distribution.
The conclusion of the test is based on the comparison between the critical value (at \(\alpha\) significance level) and statistic of the test:
☕
- if critical \(\leq\) statistic:
Fail to reject \(H_0:\) (e.g., data is Normal)
- else:
Reject \(H_0:\) (e.g., data is not Normal)
The critical values are obtained using
_critical_value().Warning
The estimated \(p_{value}\) may not be accurate as it is calculated using linear interpolation.
References
[1]FILLIBEN, J. J. The Probability Plot Correlation Coefficient Test for Normality. Technometrics, v. 17, n. 1, p. 111-117, 1975.
Examples
>>> from normtest import filliben >>> from scipy import stats >>> data = stats.norm.rvs(loc=0, scale=1, size=30, random_state=42) >>> result = filliben.fi_test(data) >>> print(result) Filliben(statistic=0.9905837698603658, critical=0.964, p_value=0.7791884930182895, conclusion='Fail to reject Hâ‚€')