Code Documentation🔗
Welcome to the technical documentation for ts-stat-tests. This section provides detailed API references for all modules, information on our quality assurance processes, and live code coverage reports.
For a detailed analysis of the underlying mathematical models and a full catalog of supported tests, please see the Algorithms Guide.
Key Features🔗
- Unified Interface: Each statistical test is accessible through a standardised dispatcher function, providing a consistent user experience across different algorithms.
- Boolean Checkers: Each test module includes a corresponding
is_<test>()function that returns a simple Boolean result, indicating whether the null hypothesis is accepted or rejected at a specified significance level. - Comprehensive Documentation: Each module is thoroughly documented with theoretical backgrounds, algorithmic details, and practical usage examples, ensuring users can easily understand and apply the tests.
- Robust Testing Suite: The package includes an extensive suite of unit tests, achieving 100% code coverage to ensure reliability and correctness of all implementations.
- Error Handling: Standardised error handling across all modules ensures that users receive clear and informative feedback when inputs do not meet the required specifications.
- Type Safety: The use of strict type-checking with
@typecheckeddecorators ensures that function inputs and outputs adhere to expected types, reducing runtime errors and improving code reliability. - Extensibility: The modular design allows for easy addition of new statistical tests and algorithms in the future, facilitating ongoing development and enhancement of the library.
- Integration with Established Libraries: The package leverages well-known libraries such as
statsmodels,pmdarima,tsfeatures, andantropyto implement the statistical tests, ensuring that users benefit from established and validated methodologies. - Quality Assurance: All code passes stringent quality gates, including
Pylintscores of 10/10 and zeroPyrighterrors, ensuring high standards of code quality and maintainability.
Modules🔗
| Module | Description |
|---|---|
| Correlation | Tests to measure autocorrelation and cross-correlation in time series data. |
| Regularity | Tests to measure the complexity and regularity of time series data. |
| Seasonality | Tests to identify seasonal patterns and measure seasonal strength in time series data. |
| Stability | Tests to measure the stability and lumpiness of time series data. |
| Stationarity | Tests to determine if a time series is stationary or possesses unit roots. |
| Normality | Tests to assess if the residuals of a time series model follow a normal distribution. |
| Linearity | Tests to evaluate linear specifications in time-series models. |
| Heteroscedasticity | Tests to detect heteroscedasticity in the residuals of time series models. |
Testing🔗
This package maintains 100% test coverage with comprehensive testing against:
- Code Style: All code adheres to
blackformatting, including all code chunks in docstrings using theblacken-docs. - Spell Checking: All documentation and code comments are spell-checked using
codespell. - Type Safety: All code is type-checked using
tyandpyrightand guarded during runtype by using thetypeguardlibrary. - Import Sorting: All imports are sorted and managed using
isortand unused imports are removed usingpycln. - Code Quality: All code is checked for quality using
pylintmaintaining a score of 10/10, and checked for complexity usingcomplexipy. - Docstring Quality: All docstrings are checked for style and completeness using
docstring-format-checker. - Unit Testing: All code is unit-tested using
pytestachieving 100% code coverage across the entire codebase, and including all examples in all docstrings tested usingdoctest. - Build Testing: The package is built with
uvand the docs are built withmkdocsto ensure there are no build errors.