distance-correlation


Namedistance-correlation JSON
Version 0.0.2 PyPI version JSON
download
home_pagehttps://github.com/asemic-horizon/distance_correlation
SummaryComputes distance covariances/correlations between vectors and distance covariance/correlation matrices for data matrices
upload_time2024-03-01 16:24:38
maintainer
docs_urlNone
authorDiego Navarro
requires_python>=3.9
license
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # distance correlation

Distance correlation is a measure of dependence between two vectors. It's particularly known for the nice property that two uncorrelated vectors are guaranteed to be independent.

In slightly more detail: given X and Y random vectors, distance covariance is a metric (called the [energy distance](https://en.wikipedia.org/wiki/Energy_distance)) of how distant is the actual joint distribution (X,Y) from the alternate distribution that would hold if X and Y were independent. [Wikipedia has the technical details](https://en.wikipedia.org/wiki/Distance_correlation), but to illustrate its main properties we'll borrow the following chart, with depicts a few point cloud-type datasets and their distance correlation:

![Distance Correlation - examples](https://upload.wikimedia.org/wikipedia/commons/thumb/9/99/Distance_Correlation_Examples.svg/1024px-Distance_Correlation_Examples.svg.png)

- Unlike Pearson correlation, distance correlation is bounded between 0 and 1, and doesn't have an interpretation of linear directionality, Therefore negatively sloped lines have perfect correlation = 1.
- Distance correlation is quite adept at detecting nonlinear structures. The Pearson correlation for all the charts in the third row is 0, 

I've always been interested in distance correlation and tried to use it in my datasets, but it's quite computation-intensive in ways that aren't easy to vectorize for numpy optimizations. This package relies on a custom-written C++ extension that leverages [pybind11](https://github.com/pybind/pybind11) for Python integration and the excellent [Eigen3](https://eigen.tuxfamily.org/index.php?title=Main_Page) library for C++ linear algebra that saves the heartache of manual memory management.



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/asemic-horizon/distance_correlation",
    "name": "distance-correlation",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": "",
    "keywords": "",
    "author": "Diego Navarro",
    "author_email": "the.electric.me@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/e6/42/e61b7293d60f616197ebae424c78974736b26632138c89e15ffc8a2cde00/distance_correlation-0.0.2.tar.gz",
    "platform": null,
    "description": "# distance correlation\n\nDistance correlation is a measure of dependence between two vectors. It's particularly known for the nice property that two uncorrelated vectors are guaranteed to be independent.\n\nIn slightly more detail: given X and Y random vectors, distance covariance is a metric (called the [energy distance](https://en.wikipedia.org/wiki/Energy_distance)) of how distant is the actual joint distribution (X,Y) from the alternate distribution that would hold if X and Y were independent. [Wikipedia has the technical details](https://en.wikipedia.org/wiki/Distance_correlation), but to illustrate its main properties we'll borrow the following chart, with depicts a few point cloud-type datasets and their distance correlation:\n\n![Distance Correlation - examples](https://upload.wikimedia.org/wikipedia/commons/thumb/9/99/Distance_Correlation_Examples.svg/1024px-Distance_Correlation_Examples.svg.png)\n\n- Unlike Pearson correlation, distance correlation is bounded between 0 and 1, and doesn't have an interpretation of linear directionality, Therefore negatively sloped lines have perfect correlation = 1.\n- Distance correlation is quite adept at detecting nonlinear structures. The Pearson correlation for all the charts in the third row is 0, \n\nI've always been interested in distance correlation and tried to use it in my datasets, but it's quite computation-intensive in ways that aren't easy to vectorize for numpy optimizations. This package relies on a custom-written C++ extension that leverages [pybind11](https://github.com/pybind/pybind11) for Python integration and the excellent [Eigen3](https://eigen.tuxfamily.org/index.php?title=Main_Page) library for C++ linear algebra that saves the heartache of manual memory management.\n\n\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Computes distance covariances/correlations between vectors and distance covariance/correlation matrices for data matrices",
    "version": "0.0.2",
    "project_urls": {
        "Homepage": "https://github.com/asemic-horizon/distance_correlation"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e642e61b7293d60f616197ebae424c78974736b26632138c89e15ffc8a2cde00",
                "md5": "6c01935143fc435c9b0a01062efe4fe5",
                "sha256": "93475b8d41593ed5e274229b8baf074561c56ffde29c639396860214f703ce03"
            },
            "downloads": -1,
            "filename": "distance_correlation-0.0.2.tar.gz",
            "has_sig": false,
            "md5_digest": "6c01935143fc435c9b0a01062efe4fe5",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 9061,
            "upload_time": "2024-03-01T16:24:38",
            "upload_time_iso_8601": "2024-03-01T16:24:38.981814Z",
            "url": "https://files.pythonhosted.org/packages/e6/42/e61b7293d60f616197ebae424c78974736b26632138c89e15ffc8a2cde00/distance_correlation-0.0.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-01 16:24:38",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "asemic-horizon",
    "github_project": "distance_correlation",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "distance-correlation"
}
        
Elapsed time: 0.24919s