Skip to main content

A Python implementation of the ecolRxC algorithm

Project description

# pycolRxC

## A Python implementation of the ecolRxC algorithm

### Description

This project is an implementation of the ecolRxC algorithm, described[1] and originally implemented in R[2] by Jose M. Pavia and Søren Risbjerg Thomsen.

This implementation makes use of NumPy, SciPy and Numba, and reaches a 100-time speed-up compared to the original R implementation or a Python version without using Numba. This has been benchmarked with a small dataset, the same as in example.py, using timeit for the Python implementation and microbenchmark for the original R library. On this dataset, the R implementation took on average between 3 and 5 minutes, while this implementation takes about 2 to 3 seconds.

For a description of the algorithm, please consult [1], and for a simple example on using this library look at example.py.

Also, please note that only a small subset of the original library’s features have been implemented. Notably, only the probit-scale Thomsen method for matrices larger than 2-by-2 has been implemented. In addition, the following have not been implemented:

  • census changes

  • references

  • confidence intervals

  • Yule’s approximation

However, most of the groundwork has been laid such that ir should be trivial to add all the capabilities of the original.

[1] Pavía, J. M., & Thomsen, S. R. (2024). ecolRxC: Ecological inference estimation of R × C tables using latent structure approaches. Political Science Research and Methods, 1–19. doi:10.1017/psrm.2024.57

[2] https://cran.r-project.org/web/packages/ecolRxC/index.html

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

pycolrxc-0.1.0.tar.gz (17.1 kB view details)

Uploaded Source

Built Distribution

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

pycolrxc-0.1.0-py3-none-any.whl (18.0 kB view details)

Uploaded Python 3

File details

Details for the file pycolrxc-0.1.0.tar.gz.

File metadata

  • Download URL: pycolrxc-0.1.0.tar.gz
  • Upload date:
  • Size: 17.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for pycolrxc-0.1.0.tar.gz
Algorithm Hash digest
SHA256 384440ce838abc4eebeda91acae0a154da461c39dc8165af969681b3284af8c4
MD5 4153c03b1820b85abb9524d527ba4333
BLAKE2b-256 bf079be7a19558bf0630dd063769aefb98745f26dc017c618e2489d070db926b

See more details on using hashes here.

File details

Details for the file pycolrxc-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pycolrxc-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 18.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for pycolrxc-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 71031cc51a2e6a46f403a89bd7143ccbeba565991da441fe8d00ed81996ed793
MD5 abc12c4d718810d5b02988b63c747ff1
BLAKE2b-256 c9b93195be30591e755ba1ef786639569182863a94b1439901bfe639be2c510c

See more details on using hashes here.

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