Filliben#

class normtest.filliben.Filliben(alpha=0.05, safe=True, **kwargs)[source]#

This class instantiates an object to perform the Filliben Normality test [1].

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
>>> import numpy as np
>>> x = np.array([6, 1, -4, 8, -2, 5, 0])
>>> test = Filliben()
>>> test.fit(x)
>>> print(test.normality)
Filliben(statistic=0.9854095718708367, critical=0.899, p_value=0.8889294725781878, conclusion='Fail to reject H₀')
Attributes:
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).

alphafloat, optional

The level of significance (\(\alpha\)). Default is 0.05;

normalitynamed tuple

A tuple with the main test results summarized

normality_hypothesisstr

Description of the Normality test

safebool, optional

Whether to check the inputs before performing the calculations (True, default) or not (False). Useful for beginners to identify problems in data entry (may reduce algorithm execution time);

Methods

fit(x_data)

Applies the Filliben Normality test;

dist_plot(axes, alphas=[0.10, 0.05, 0.01]):

Generates axis with critical data from the Filliben Normality test;

correlation_plot(axes)

Generates an axis with the Filliben test correlation graph;

line_up(seed=None, correct=False)

Generates a Figure with the correlation graphs for the line up method;

citation(export=False)

Returns the Filliben’s test reference;

citation(export=False)[source]#

This method returns the reference from Filliben’s test, with the option to export the reference in .bib format.

Parameters:
exportbool

Whether to export the reference as Filliben1975.bib file (True) or not (False, default);

Returns:
referencestr

The Filliben Test reference

correlation_plot(axes)[source]#

This method creates an axis with the Filliben test correlation graph.

Parameters:
axesmatplotlib.axes.SubplotBase

The axis of the graph;

Returns:
axesmatplotlib.axes.SubplotBase

The axis of the graph;

See also

correlation_plot
dist_plot(axes, alphas=[0.1, 0.05, 0.01])[source]#

This method generates an axis with critical data from the Filliben Normality test.

Parameters:
axesmatplotlib.axes.SubplotBase

The axis of the graph;

alphaslist of floats, optional

The significance level (\(\alpha\)) to draw the critical lines. Default is [0.10, 0.05, 0.01];

Returns:
axesmatplotlib.axes.SubplotBase

The axis of the graph;

See also

dist_plot
fit(x_data)[source]#

This method applies the Filliben test.

Parameters:
x_datanumpy array

One dimension numpy array with at least 4 observations.

Returns:
x_datanumpy array

One dimension numpy array with at least 4 observations.

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).

normalitynamed tuple

A tuple with the main test results summarized

See also

fi_test
get_alpha()#

Returns the current alpha value

Returns:
alphafloat

The level of significance (\(\alpha\)).

get_safe()#

Returns the current status of parameter safe

Returns:
safebool, optional

Whether to check the inputs before performing the calculations (True, default) or not (False). Useful for beginners to identify problems in data entry (may reduce algorithm execution time);

line_up(seed=None, correct=False)[source]#

This method generates a Figure with the correlation graphs for the line up method.

Parameters:
seedint or None, optional

A numerical value that generates a new set or repeats pseudo-random numbers. Use a positive integer value to be able to repeat results. Default is None what generates a random seed;

correctbool, optional

Whether the x_data is to be drawn in red (False) or black (True, default);

Returns:
figmatplotlib.figure.Figure

A figure with the generated graphics;

See also

line_up
set_alpha(alpha)#

Changes the alpha value

Parameters:
alphafloat

The level of significance (\(\alpha\)).

Notes

This method only allows input of type float and between 0.0 and 1.0.

set_safe(safe)#

Changes the current status of parameter safe

Parameters:
safebool, optional

Whether to check the inputs before performing the calculations (True, default) or not (False). Useful for beginners to identify problems in data entry (may reduce algorithm execution time);