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
Using pycolRxC from within R
It might be useful to use pycolRxC inside R, as an alternative to the original implementation.
This can be accomplished using the reticulate package.
The file example.R contains a simple example on using pycolRxC within R.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pycolrxc-0.2.0.tar.gz.
File metadata
- Download URL: pycolrxc-0.2.0.tar.gz
- Upload date:
- Size: 17.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ede9366bba8225cd94348f81467d261541b8542ddf94cd28d8b6c194aeb50ee7
|
|
| MD5 |
ba28984c5d3432adf024e7dda5808ee7
|
|
| BLAKE2b-256 |
84fb65ec97a2607f78654e5f26f063a044e94637e3f532a6ff3740b3153a3ea7
|
File details
Details for the file pycolrxc-0.2.0-py3-none-any.whl.
File metadata
- Download URL: pycolrxc-0.2.0-py3-none-any.whl
- Upload date:
- Size: 17.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3e5f8d8736261872abc6818996d3c43e3893c6baf73216b14af298a8018f3faf
|
|
| MD5 |
8b432d3b951953ee69e08601ca45b2f9
|
|
| BLAKE2b-256 |
d4864be0a54488747c820ab7422e1e2366469491294b2b9a2b18a32d9a7ddba3
|