Metadata-Version: 2.1
Name: normtest
Version: 0.0.3.dev0
Summary: Check that your data follows, at least approximately, the Normal distribution.
Author-email: Anderson Marcos Dias Canteli <andersonmdcanteli@gmail.com>
License: BSD 3-Clause License
        
        Copyright (c) 2023, puzzle-in-a-mug
        
        Redistribution and use in source and binary forms, with or without
        modification, are permitted provided that the following conditions are met:
        
        1. Redistributions of source code must retain the above copyright notice, this
           list of conditions and the following disclaimer.
        
        2. Redistributions in binary form must reproduce the above copyright notice,
           this list of conditions and the following disclaimer in the documentation
           and/or other materials provided with the distribution.
        
        3. Neither the name of the copyright holder nor the names of its
           contributors may be used to endorse or promote products derived from
           this software without specific prior written permission.
        
        THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
        AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
        IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
        DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
        FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
        DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
        SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
        CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
        OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
        OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
        
Project-URL: Source, https://github.com/puzzle-in-a-mug/normtest
Project-URL: Docs, https://normtest.readthedocs.io/en/latest/index.html
Keywords: normality,sample,test
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy >=1.23.5
Requires-Dist: pandas >=1.5.3
Requires-Dist: matplotlib >=3.7.1
Requires-Dist: scipy >=1.11.3
Requires-Dist: paramcheckup >=1.0.1

<img src="https://raw.githubusercontent.com/puzzle-in-a-mug/normtest/main/docs/_static/favicon-180x180.png" align="right" />

# normtest



This package has a series of tests used to check whether a set of sample data follows, at least approximately, the Normal distribution.

## Available tests (25/11/2023)

- Filliben
- Ryan-Joiner
- Looney-Gulledge


## Install

```
pip install normtest
```

## Usage

Each test has its own class and can be imported as follows:

```python
from normtest import RyanJoiner
from normtest import Filliben
from normtest import LooneyGulledge
```

To perform the test, just instantiate the class and apply the ``fit`` method, passing the data set as a ``NumpyArray``. For example:

```python
import numpy as np
test = RyanJoiner()
x_data = np.array([6, 1, -4, 8, -2, 5, 0])
test.fit(x_data)
```


After the ``fit`` method is applied, the ``test`` ``object`` now has a series of attributes with the test results. The main attribute is ``test.normality``, which contains the summarized results:

```python
print(test.normality)
RyanJoiner(statistic=0.9844829186140105, critical=0.8977794003662074, p_value='p > 0.100', conclusion='Fail to reject H₀')
```

The ``test`` ``object`` also has methods for graphical visualization of results, such as the ``line_up`` method. See the [documentation](https://normtest.readthedocs.io/en/latest/source/ryan_joiner/RyanJoiner.html) for details.


Each test has its individual module, and functions can be accessed through the modules. To import the module that contains all the RyanJoiner test functions, for example, use:

```python
from normtest import ryan_joiner
```

This way, it is possible to generate graphs and obtain intermediate values from the test calculations. For example:

```python
size = 7
pi = ryan_joiner._order_statistic(size)
print(pi)
[0.0862069  0.22413793 0.36206897 0.5        0.63793103 0.77586207
 0.9137931 ]
```




## License

- [BSD 3-Clause License](https://github.com/puzzle-in-a-mug/normtest/blob/main/LICENSE)
