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.0.1.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.0.1-py3-none-any.whl (18.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pycolrxc-0.0.1.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.0.1.tar.gz
Algorithm Hash digest
SHA256 6bbdfc9d05f28d03b5c2f8c2f85e36882391c2f041dcbf34e53aa1cd512060ee
MD5 71fe59eb902c1ffb0d08b12f4c09cf23
BLAKE2b-256 5d6b89db9e5008e2d3f7eb6ae1ff91427f117f37ac3140ae1dcf5b7e7f5652d9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pycolrxc-0.0.1-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.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 562f348dd5433e41dd89a6ff887ce5da91cd8d2b486848268231db5b7c36f770
MD5 7aec52f4d9bcfe89f7536f864b8358eb
BLAKE2b-256 32353d636965f0d4e9d0c4c0ead0ba43a5106da2c4853d30205e8ecd65fa6938

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