Skip to main content

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

Project description

rtacpy

PyPI Docs Tests Changelog License

A Python package for calculating RTAC, 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 rtacpy

Usage

import numpy as np
from rtacpy import calc_rtac, 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)
rtac, p_value = area_coverage_independence_test(x, y, null_dist=null_dist)
print(f'x and y are independent, rtac = {rtac}, p_value = {p_value}')
y = np.square(x)
rtac, p_value = area_coverage_independence_test(x, y, null_dist=null_dist)
print(f'x and y are dependent, rtac = {rtac}, p_value = {p_value}')

# If p_value is not needed, you can calculate just rtac
rtac_2 = calc_rtac(x,y)
assert rtac == rtac_2

Development

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

cd rtacpy
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

rtacpy-0.1.5.tar.gz (9.9 kB view details)

Uploaded Source

Built Distribution

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

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: rtacpy-0.1.5.tar.gz
  • Upload date:
  • Size: 9.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for rtacpy-0.1.5.tar.gz
Algorithm Hash digest
SHA256 d1933f9b10720744b276d8af2c4e020cc907a38b463f17854b27b9ffce4a4a04
MD5 0c5481c989f865df27535414257a06f5
BLAKE2b-256 75a2db3383b3e40e21600df66ce193d5b978e0b456b08df4fcfb70a9dc59e06e

See more details on using hashes here.

Provenance

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

Publisher: publish.yml on itaipelles/rtacpy

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

File details

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

File metadata

  • Download URL: rtacpy-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.1.0 CPython/3.12.9

File hashes

Hashes for rtacpy-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 92281cdc07f0d415168617bbe9dedec8bbfc6c9eddc4f7e5b4fe9019bc51772a
MD5 dfd9ad346cb1f14fc057ef59b08a061e
BLAKE2b-256 d1fe7ab06f661b8f33afa7bfac4f2e4050ca29172242f3edc086faf3d5b50bae

See more details on using hashes here.

Provenance

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

Publisher: publish.yml on itaipelles/rtacpy

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