copulax


Namecopulax JSON
Version 1.0.1 PyPI version JSON
download
home_pageNone
SummaryCopula, multivariate and univariate distribution fitting using JAX in python.
upload_time2025-07-30 16:37:28
maintainerNone
docs_urlNone
authorNone
requires_python<3.13,>=3.10
licenseMIT License Copyright (c) 2025 CopulAX Developers Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords sklar copula copulas copulae probability distribution univariate bivariate multivariate joint cdf pdf modeling quantitative fitting scipy statistics mathematics science scientific finance risk var machine learning variables jax
VCS
bugtrack_url
requirements jax jaxopt quadax requests tensorflow-probability interpax matplotlib
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # CopulAX

<p align="center">
    <a href="https://www.python.org">
        <img alt="PyPI - Python Version" src="https://img.shields.io/pypi/pyversions/copulax"></a> &nbsp;
    <a href="https://pypi.org/project/copulax/">
        <img alt="PyPI - Package Version" src="https://img.shields.io/pypi/v/copulax"></a> &nbsp;
    <a href="https://github.com/tfm000/copulax/blob/main/LICENSE.txt">
        <img src="https://img.shields.io/badge/license-MIT-brightgreen.svg"
            alt="MIT license"></a> &nbsp;
    <a href="https://github.com/tfm000/copulax/actions/workflows/tests.yml">
        <img src="https://github.com/tfm000/copulax/actions/workflows/tests.yml/badge.svg?branch=main"
            alt="build"></a> &nbsp;
    <a href="https://codecov.io/github/tfm000/copulax">
        <img src="https://codecov.io/gh/tfm000/copulax/graph/badge.svg?token=OM89GVW36L"
            alt="coverage"></a> &nbsp;
    <!-- <a href="https://sklarpy.readthedocs.io/en/latest/?badge=latest">
        <img src="https://readthedocs.org/projects/sklarpy/badge/?version=latest"
            alt="build"></a> &nbsp;
    <a href="https://pepy.tech/project/sklarpy">
        <img src="https://static.pepy.tech/personalized-badge/sklarpy?period=total&units=international_system&left_color=black&right_color=orange&left_text=Downloads"
            alt="downloads"></a> &nbsp; -->
    <!-- <a href="https://pypi.org/project/sklarpy/"> -->
    <a href="https://github.com/tfm000/copulax/">
        <img src="https://img.shields.io/badge/Maintained%3F-yes-green.svg"
            alt="maintained"></a>
</p>

<p align="center">
    <!-- <a href="https://pypi.org/project/sklarpy/"> -->
    <a href="https://github.com/tfm000/copulax/">
        <img src="https://img.shields.io/badge/mac%20os-000000?style=for-the-badge&logo=apple&logoColor=white"
            alt="mac os"></a>
    <!-- <a href="https://pypi.org/project/sklarpy/"> -->
    <a href="https://github.com/tfm000/copulax/">
        <img src="https://img.shields.io/badge/Windows-0078D6?style=for-the-badge&logo=windows&logoColor=white"
            alt="windows"></a>
    <!-- <a href="https://github.com/tfm000/copulax/">
        <img src="https://img.shields.io/badge/Ubuntu-E95420?style=for-the-badge&logo=ubuntu&logoColor=white"
            alt="windows"></a> -->
</p>

CopulAX is an open-source software for probability distribution fitting written in [JAX](https://github.com/jax-ml/jax/), with an emphasis on low-dimensional optimization. The spirital successor to the eariler [SklarPy](https://github.com/tfm000/sklarpy/) project, this JAX implementation provides improved standardization and optimization performance across distribution objects, in addition to inbuilt automatic differentiation capabilities and greater speed via JIT compilation for both CPUs and GPUs.

We foresee this library having many different possible use cases, ranging from machine learning to finance.

## Table of contents

- [Table of contents](#table_of_contents)
- [Installation](#installation)
- [Low-Dimensional Optimization](#low-dimensional-optimization)
- [Implemented Distributions](#implemented-distributions)
- [Examples](#examples)

## Installation

CopulAX is available on PyPI and can be installed by running:

```bash
pip install copulax
```

## Low-Dimensional Optimization

In many fields data remains limited, which can be one of the main motivators for using probabilistic software which can allow the generaton of additional data points with similar statistical properties. However, when dealing with multivariate data, even this can become challenging, due the shape / covariance / correlation matrix arguments of many multivariate and copula distributions resulting in the number of parameters required to be estimated to be O($d^2$). CopulAX aims to work around this constraint where possible, by using analytical relationships between the mean and covariance matrices and other parameters; Estimating the mean and covariance using techniques robust to low sample sizes, then allows for distribution fitting in such settings by removing a large number of the estimated parameters from the numerical optimization loop.

## Development Status

As CopulAX is still in its early stages, we have so far only released a limited number of continuous univariate and multivariate distributions and their copulas, however in the near future we aim to implement the following:

- Many more univariate distributions, including for discrete variables.
- Incorporating goodness of fit tests into univariate_fitter.
- More multivariate distributions. Namely, the special and limiting cases of the generalized hyperbolic.
- Copulas based on each of the aformentioned multivariate distributions.
- Cdf functions for multivariate and copula distributions. This will depend upon the progress of third party jax-based numerical integration libraries such as [quadax](https://github.com/f0uriest/quadax).
- Archimedean copulas.
- Empirical distributions, with different fitting methods (smoothing splines vs 'as is'/ non-smoothed).

CopulAX is currently under active development and so bugs are to be expected. However we have extensive tests for each distribution and function, so we are aiming to limit there number.

## Implemented Distributions

A list of all implemented distributions can be found here:

- <a href="https://github.com/tfm000/copulax/blob/main/copulax/univariate/README.md">Univariate implemented distributions</a>
- <a href="https://github.com/tfm000/copulax/blob/main/copulax/multivariate/README.md">Multivariate implemented distributions</a>
- <a href="https://github.com/tfm000/copulax/blob/main/copulax/copulas/README.md">Copula implemented distributions</a>

## Examples

We have provided <a href="https://github.com/tfm000/copulax/tree/main/examples">jupyter notebooks</a> containing example code for using univariate, multivariate and copula distribution objects.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "copulax",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<3.13,>=3.10",
    "maintainer_email": "Tyler Mitchell <tylerfmitchell1999@gmail.com>",
    "keywords": "Sklar, Copula, Copulas, Copulae, Probability, Distribution, Univariate, Bivariate, Multivariate, Joint, CDF, PDF, Modeling, Quantitative, Fitting, SciPy, Statistics, Mathematics, Science, Scientific, Finance, Risk, VaR, Machine Learning, Variables, JAX",
    "author": null,
    "author_email": "Tyler Mitchell <tylerfmitchell1999@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/c0/1d/d5334d512f78504eaf2836b05150335e6b0fce4c3b256f7b66cedc8127d0/copulax-1.0.1.tar.gz",
    "platform": null,
    "description": "# CopulAX\r\n\r\n<p align=\"center\">\r\n    <a href=\"https://www.python.org\">\r\n        <img alt=\"PyPI - Python Version\" src=\"https://img.shields.io/pypi/pyversions/copulax\"></a> &nbsp;\r\n    <a href=\"https://pypi.org/project/copulax/\">\r\n        <img alt=\"PyPI - Package Version\" src=\"https://img.shields.io/pypi/v/copulax\"></a> &nbsp;\r\n    <a href=\"https://github.com/tfm000/copulax/blob/main/LICENSE.txt\">\r\n        <img src=\"https://img.shields.io/badge/license-MIT-brightgreen.svg\"\r\n            alt=\"MIT license\"></a> &nbsp;\r\n    <a href=\"https://github.com/tfm000/copulax/actions/workflows/tests.yml\">\r\n        <img src=\"https://github.com/tfm000/copulax/actions/workflows/tests.yml/badge.svg?branch=main\"\r\n            alt=\"build\"></a> &nbsp;\r\n    <a href=\"https://codecov.io/github/tfm000/copulax\">\r\n        <img src=\"https://codecov.io/gh/tfm000/copulax/graph/badge.svg?token=OM89GVW36L\"\r\n            alt=\"coverage\"></a> &nbsp;\r\n    <!-- <a href=\"https://sklarpy.readthedocs.io/en/latest/?badge=latest\">\r\n        <img src=\"https://readthedocs.org/projects/sklarpy/badge/?version=latest\"\r\n            alt=\"build\"></a> &nbsp;\r\n    <a href=\"https://pepy.tech/project/sklarpy\">\r\n        <img src=\"https://static.pepy.tech/personalized-badge/sklarpy?period=total&units=international_system&left_color=black&right_color=orange&left_text=Downloads\"\r\n            alt=\"downloads\"></a> &nbsp; -->\r\n    <!-- <a href=\"https://pypi.org/project/sklarpy/\"> -->\r\n    <a href=\"https://github.com/tfm000/copulax/\">\r\n        <img src=\"https://img.shields.io/badge/Maintained%3F-yes-green.svg\"\r\n            alt=\"maintained\"></a>\r\n</p>\r\n\r\n<p align=\"center\">\r\n    <!-- <a href=\"https://pypi.org/project/sklarpy/\"> -->\r\n    <a href=\"https://github.com/tfm000/copulax/\">\r\n        <img src=\"https://img.shields.io/badge/mac%20os-000000?style=for-the-badge&logo=apple&logoColor=white\"\r\n            alt=\"mac os\"></a>\r\n    <!-- <a href=\"https://pypi.org/project/sklarpy/\"> -->\r\n    <a href=\"https://github.com/tfm000/copulax/\">\r\n        <img src=\"https://img.shields.io/badge/Windows-0078D6?style=for-the-badge&logo=windows&logoColor=white\"\r\n            alt=\"windows\"></a>\r\n    <!-- <a href=\"https://github.com/tfm000/copulax/\">\r\n        <img src=\"https://img.shields.io/badge/Ubuntu-E95420?style=for-the-badge&logo=ubuntu&logoColor=white\"\r\n            alt=\"windows\"></a> -->\r\n</p>\r\n\r\nCopulAX is an open-source software for probability distribution fitting written in [JAX](https://github.com/jax-ml/jax/), with an emphasis on low-dimensional optimization. The spirital successor to the eariler [SklarPy](https://github.com/tfm000/sklarpy/) project, this JAX implementation provides improved standardization and optimization performance across distribution objects, in addition to inbuilt automatic differentiation capabilities and greater speed via JIT compilation for both CPUs and GPUs.\r\n\r\nWe foresee this library having many different possible use cases, ranging from machine learning to finance.\r\n\r\n## Table of contents\r\n\r\n- [Table of contents](#table_of_contents)\r\n- [Installation](#installation)\r\n- [Low-Dimensional Optimization](#low-dimensional-optimization)\r\n- [Implemented Distributions](#implemented-distributions)\r\n- [Examples](#examples)\r\n\r\n## Installation\r\n\r\nCopulAX is available on PyPI and can be installed by running:\r\n\r\n```bash\r\npip install copulax\r\n```\r\n\r\n## Low-Dimensional Optimization\r\n\r\nIn many fields data remains limited, which can be one of the main motivators for using probabilistic software which can allow the generaton of additional data points with similar statistical properties. However, when dealing with multivariate data, even this can become challenging, due the shape / covariance / correlation matrix arguments of many multivariate and copula distributions resulting in the number of parameters required to be estimated to be O($d^2$). CopulAX aims to work around this constraint where possible, by using analytical relationships between the mean and covariance matrices and other parameters; Estimating the mean and covariance using techniques robust to low sample sizes, then allows for distribution fitting in such settings by removing a large number of the estimated parameters from the numerical optimization loop.\r\n\r\n## Development Status\r\n\r\nAs CopulAX is still in its early stages, we have so far only released a limited number of continuous univariate and multivariate distributions and their copulas, however in the near future we aim to implement the following:\r\n\r\n- Many more univariate distributions, including for discrete variables.\r\n- Incorporating goodness of fit tests into univariate_fitter.\r\n- More multivariate distributions. Namely, the special and limiting cases of the generalized hyperbolic.\r\n- Copulas based on each of the aformentioned multivariate distributions.\r\n- Cdf functions for multivariate and copula distributions. This will depend upon the progress of third party jax-based numerical integration libraries such as [quadax](https://github.com/f0uriest/quadax).\r\n- Archimedean copulas.\r\n- Empirical distributions, with different fitting methods (smoothing splines vs 'as is'/ non-smoothed).\r\n\r\nCopulAX is currently under active development and so bugs are to be expected. However we have extensive tests for each distribution and function, so we are aiming to limit there number.\r\n\r\n## Implemented Distributions\r\n\r\nA list of all implemented distributions can be found here:\r\n\r\n- <a href=\"https://github.com/tfm000/copulax/blob/main/copulax/univariate/README.md\">Univariate implemented distributions</a>\r\n- <a href=\"https://github.com/tfm000/copulax/blob/main/copulax/multivariate/README.md\">Multivariate implemented distributions</a>\r\n- <a href=\"https://github.com/tfm000/copulax/blob/main/copulax/copulas/README.md\">Copula implemented distributions</a>\r\n\r\n## Examples\r\n\r\nWe have provided <a href=\"https://github.com/tfm000/copulax/tree/main/examples\">jupyter notebooks</a> containing example code for using univariate, multivariate and copula distribution objects.\r\n",
    "bugtrack_url": null,
    "license": "MIT License\r\n        \r\n        Copyright (c) 2025 CopulAX Developers\r\n        \r\n        Permission is hereby granted, free of charge, to any person obtaining a copy\r\n        of this software and associated documentation files (the \"Software\"), to deal\r\n        in the Software without restriction, including without limitation the rights\r\n        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r\n        copies of the Software, and to permit persons to whom the Software is\r\n        furnished to do so, subject to the following conditions:\r\n        \r\n        The above copyright notice and this permission notice shall be included in all\r\n        copies or substantial portions of the Software.\r\n        \r\n        THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r\n        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r\n        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r\n        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r\n        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r\n        SOFTWARE.",
    "summary": "Copula, multivariate and univariate distribution fitting using JAX in python.",
    "version": "1.0.1",
    "project_urls": {
        "Bug Reports": "https://github.com/tfm000/copulax/issues",
        "Homepage": "https://github.com/tfm000/copulax",
        "Source": "https://github.com/tfm000/copulax"
    },
    "split_keywords": [
        "sklar",
        " copula",
        " copulas",
        " copulae",
        " probability",
        " distribution",
        " univariate",
        " bivariate",
        " multivariate",
        " joint",
        " cdf",
        " pdf",
        " modeling",
        " quantitative",
        " fitting",
        " scipy",
        " statistics",
        " mathematics",
        " science",
        " scientific",
        " finance",
        " risk",
        " var",
        " machine learning",
        " variables",
        " jax"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "5718a7d1e2cdaa25422e9afa12256496b80643049f3b439576795e53f1b1b5e3",
                "md5": "56cc4a22eafed7fb1ea10ff5268ab13b",
                "sha256": "2e1861cd0508e398fd9f861d563ea55b64d6f6178b8d30b4954fd86b15068fb1"
            },
            "downloads": -1,
            "filename": "copulax-1.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "56cc4a22eafed7fb1ea10ff5268ab13b",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<3.13,>=3.10",
            "size": 85986,
            "upload_time": "2025-07-30T16:37:27",
            "upload_time_iso_8601": "2025-07-30T16:37:27.591283Z",
            "url": "https://files.pythonhosted.org/packages/57/18/a7d1e2cdaa25422e9afa12256496b80643049f3b439576795e53f1b1b5e3/copulax-1.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "c01dd5334d512f78504eaf2836b05150335e6b0fce4c3b256f7b66cedc8127d0",
                "md5": "5795dd09a49b0d8a7f3fd4730a0d6f78",
                "sha256": "fcaf6e85e5739e797c60e7d4cfe0abcc3130f13f5e1eda4d4ac49d2901e8a83e"
            },
            "downloads": -1,
            "filename": "copulax-1.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "5795dd09a49b0d8a7f3fd4730a0d6f78",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<3.13,>=3.10",
            "size": 223209,
            "upload_time": "2025-07-30T16:37:28",
            "upload_time_iso_8601": "2025-07-30T16:37:28.910637Z",
            "url": "https://files.pythonhosted.org/packages/c0/1d/d5334d512f78504eaf2836b05150335e6b0fce4c3b256f7b66cedc8127d0/copulax-1.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-30 16:37:28",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "tfm000",
    "github_project": "copulax",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "jax",
            "specs": [
                [
                    ">=",
                    "0.4.31"
                ]
            ]
        },
        {
            "name": "jaxopt",
            "specs": [
                [
                    ">=",
                    "0.8.3"
                ]
            ]
        },
        {
            "name": "quadax",
            "specs": [
                [
                    ">=",
                    "0.2.2"
                ]
            ]
        },
        {
            "name": "requests",
            "specs": [
                [
                    ">=",
                    "2.32.3"
                ]
            ]
        },
        {
            "name": "tensorflow-probability",
            "specs": [
                [
                    ">=",
                    "0.25.0"
                ]
            ]
        },
        {
            "name": "interpax",
            "specs": [
                [
                    ">=",
                    "0.3.7"
                ]
            ]
        },
        {
            "name": "matplotlib",
            "specs": [
                [
                    ">=",
                    "3.9.2"
                ]
            ]
        }
    ],
    "lcname": "copulax"
}
        
Elapsed time: 2.11173s