Dcor
Distance correlation and related E-statistics in Python
Install / Use
/learn @vnmabus/DcorREADME
dcor
|tests| |docs| |coverage| |repostatus| |versions| |pypi| |conda| |zenodo|
dcor: distance correlation and energy statistics in Python.
E-statistics are functions of distances between statistical observations in metric spaces.
Distance covariance and distance correlation are dependency measures between random vectors introduced in [SRB07]_ with a simple E-statistic estimator.
This package offers functions for calculating several E-statistics such as:
- Estimator of the energy distance [SR13]_.
- Biased and unbiased estimators of distance covariance and distance correlation [SRB07]_.
- Estimators of the partial distance covariance and partial distance covariance [SR14]_.
It also provides tests based on these E-statistics:
- Test of homogeneity based on the energy distance.
- Test of independence based on distance covariance.
Installation
dcor is on PyPi and can be installed using :code:pip:
.. code::
pip install dcor
It is also available for :code:conda using the :code:conda-forge channel:
.. code::
conda install -c conda-forge dcor
Previous versions of the package were in the :code:vnmabus channel. This
channel will not be updated with new releases, and users are recommended to
use the :code:conda-forge channel.
Requirements
dcor is available in Python 3.8 or above in all operating systems. The package dcor depends on the following libraries:
- numpy
- numba >= 0.51
- scipy
- joblib
Citing dcor
Please, if you find this software useful in your work, reference it citing the following paper:
.. code-block::
@article{ramos-carreno+torrecilla_2023_dcor, author = {Ramos-Carreño, Carlos and Torrecilla, José L.}, doi = {10.1016/j.softx.2023.101326}, journal = {SoftwareX}, month = {2}, title = {{dcor: Distance correlation and energy statistics in Python}}, url = {https://www.sciencedirect.com/science/article/pii/S2352711023000225}, volume = {22}, year = {2023}, }
You can additionally cite the software repository itself using:
.. code-block::
@misc{ramos-carreno_2022_dcor, author = {Ramos-Carreño, Carlos}, doi = {10.5281/zenodo.3468124}, month = {3}, title = {dcor: distance correlation and energy statistics in Python}, url = {https://github.com/vnmabus/dcor}, year = {2022} }
If you want to reference a particular version for reproducibility, check the version-specific DOIs available in Zenodo.
Documentation
The documentation can be found in https://dcor.readthedocs.io/en/latest/?badge=latest
References
.. [SR13] Gábor J. Székely and Maria L. Rizzo. Energy statistics: a class of statistics based on distances. Journal of Statistical Planning and Inference, 143(8):1249 – 1272, 2013. URL: http://www.sciencedirect.com/science/article/pii/S0378375813000633, doi:10.1016/j.jspi.2013.03.018. .. [SR14] Gábor J. Székely and Maria L. Rizzo. Partial distance correlation with methods for dissimilarities. The Annals of Statistics, 42(6):2382–2412, 12 2014. doi:10.1214/14-AOS1255. .. [SRB07] Gábor J. Székely, Maria L. Rizzo, and Nail K. Bakirov. Measuring and testing dependence by correlation of distances. The Annals of Statistics, 35(6):2769–2794, 12 2007. doi:10.1214/009053607000000505.
.. |tests| image:: https://github.com/vnmabus/dcor/actions/workflows/main.yml/badge.svg :alt: Tests :target: https://github.com/vnmabus/dcor/actions/workflows/main.yml
.. |docs| image:: https://readthedocs.org/projects/dcor/badge/?version=latest :alt: Documentation Status :target: https://dcor.readthedocs.io/en/latest/?badge=latest
.. |coverage| image:: http://codecov.io/github/vnmabus/dcor/coverage.svg?branch=develop :alt: Coverage Status :target: https://codecov.io/gh/vnmabus/dcor/branch/develop
.. |repostatus| image:: https://www.repostatus.org/badges/latest/active.svg :alt: Project Status: Active – The project has reached a stable, usable state and is being actively developed. :target: https://www.repostatus.org/#active
.. |versions| image:: https://img.shields.io/pypi/pyversions/dcor :alt: PyPI - Python Version
.. |pypi| image:: https://badge.fury.io/py/dcor.svg :alt: Pypi version :target: https://pypi.python.org/pypi/dcor/
.. |conda| image:: https://img.shields.io/conda/vn/conda-forge/dcor :alt: Available in Conda :target: https://anaconda.org/conda-forge/dcor
.. |zenodo| image:: https://zenodo.org/badge/DOI/10.5281/zenodo.3468124.svg :alt: Zenodo DOI :target: https://doi.org/10.5281/zenodo.3468124
Related Skills
node-connect
335.9kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
claude-opus-4-5-migration
82.7kMigrate prompts and code from Claude Sonnet 4.0, Sonnet 4.5, or Opus 4.1 to Opus 4.5
frontend-design
82.7kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
model-usage
335.9kUse CodexBar CLI local cost usage to summarize per-model usage for Codex or Claude, including the current (most recent) model or a full model breakdown. Trigger when asked for model-level usage/cost data from codexbar, or when you need a scriptable per-model summary from codexbar cost JSON.
