Skip to main content

A Python package for calculating eta n, the rank-transform area coverage coefficient of correlation.

Project description

etacorpy

PyPI Docs Tests Changelog License

A Python package for calculating eta_n, the rank-transform area coverage coefficient of correlation. This is the official repository of the paper (link TBD):

"A coefficient of correlation for continuous random variables based on area coverage"

Installation

Install this library using pip:

pip install etacorpy

Usage

import numpy as np
from etacorpy import calc_eta_n, create_null_dist, area_coverage_independence_test
n = 100
x = np.random.rand(n)
y = np.random.rand(n)
null_dist = create_null_dist(n)
eta_n, p_value = area_coverage_independence_test(x, y, null_dist=null_dist)
print(f'x and y are independent, eta_n = {eta_n}, p_value = {p_value}')
y = np.square(x)
eta_n, p_value = area_coverage_independence_test(x, y, null_dist=null_dist)
print(f'x and y are dependent, eta_n = {eta_n}, p_value = {p_value}')

# If p_value is not needed, you can calculate just eta_n
eta_n_2 = calc_eta_n(x,y)
assert eta_n == eta_n_2

Development

To contribute to this library, first checkout the code. Then create a new virtual environment:

cd etacorpy
python -m venv venv
source venv/bin/activate

Now install the dependencies and test dependencies:

python -m pip install -e '.[test]'

To run the tests:

python -m pytest

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

etacorpy-0.1.5.tar.gz (9.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

etacorpy-0.1.5-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

File details

Details for the file etacorpy-0.1.5.tar.gz.

File metadata

  • Download URL: etacorpy-0.1.5.tar.gz
  • Upload date:
  • Size: 9.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for etacorpy-0.1.5.tar.gz
Algorithm Hash digest
SHA256 282f58adfcfb64a4396af8b4d2bbf78ce55e6f11cd4306f4bfafc716fdf6d3eb
MD5 440141f478d8c076a4b2e940fac8536e
BLAKE2b-256 2aa7c19ff764c30d653a9bc84ae59ae28c59b39c667b7e2607a65488db2a9026

See more details on using hashes here.

Provenance

The following attestation bundles were made for etacorpy-0.1.5.tar.gz:

Publisher: publish.yml on itaipelles/etacorpy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file etacorpy-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: etacorpy-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 9.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for etacorpy-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 c3f24b022f3c081e176a534d6538cf1bc2d2a59a9753996563371639d7dd74cf
MD5 20f96526ad19673163f612b132a8c4c2
BLAKE2b-256 761f3e128dcdb78726ddbcdc24b3eeef05f1fbd1c8e563a69c9cad8b2a13c78f

See more details on using hashes here.

Provenance

The following attestation bundles were made for etacorpy-0.1.5-py3-none-any.whl:

Publisher: publish.yml on itaipelles/etacorpy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page