Skip to main content

RiLACS

This package implements the martingales and confidence sequences from "RiLACS: Risk-limiting audits via confidence sequences" and contains code for reproducing all of the plots therein.

Installation

We currently support Python 3.7--3.10 on macOS (Intel/x86_64 and Apple Silicon) and Linux (x86_64).

pip install rilacs

Installation on other platforms may still be possible, but in that case, the dependency confseq would need to be installed manually. If you would like to see an additional platform supported, please open an issue at confseq, not RiLACS.

Compute a confidence sequence

import numpy as np
from rilacs.confseqs import sqKelly

# Create some data
x = np.random.binomial(1, 0.5, 1000)

# Compute the confidence sequence
l, u = sqKelly(x, N = 1000)

Run unit tests

# Clone the repository 
git clone https://github.com/WannabeSmith/RiLACS.git

# Run unit tests via pytest
pytest RiLACS

Reproduce the paper's plots

To generate all plots, we've created a shell script at RiLACS/paper_plots/generate_plots.sh:

# Enter the plots directory
cd RiLACS/paper_plots

# Execute the script with your shell, e.g.:
zsh generate_plots.sh

Alternatively, you can produce each plot one-by-one:

python RiLACS/paper_plots/distKelly_distributions/distributions.py
python RiLACS/paper_plots/relationship_to_testing/cs_testing_plots.py
# and so on.

App to audit Canada's 2019 federal election

The canada_audit folder contains code to produce a web application which allows for interactive auditing of Canadian ridings in the 2019 federal election.

For more details, view the README in canada_audit

audit

Contributing

If you find a bug, please open an issue and we'll try to fix it as soon as possible.

Citing

The algorithms in this codebase are based on "RiLACS: Risk-limiting audits via confidence sequences" by Ian Waudby-Smith, Philip B. Stark, and Aaditya Ramdas. The BibTeX entry is provided here.

@inproceedings{waudby2021rilacs, title={RiLACS: Risk Limiting Audits via Confidence Sequences}, author={Waudby-Smith, Ian and Stark, Philip B and Ramdas, Aaditya}, booktitle={International Joint Conference on Electronic Voting}, pages={124--139}, year={2021}, organization={Springer} }

Metadata

Release files for rilacs 1.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rilacs 1.0.3
File Size Uploaded
rilacs-1.0.3.tar.gz 12.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for rilacs 1.0.3
File Interpreter ABI Platform
rilacs-1.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 23.2 kB

Release files / rilacs-1.0.3.tar.gz

Download URL rilacs-1.0.3.tar.gz
Size 12.5 kB
Tags Source
SHA-256 checksum
How to use checksums
af69c4cbf917e4b204310a27c3cb7522c5869fe9dcb21bf210d58f460a4aedb8
BLAKE2b-256 checksum
How to use checksums
5e69ebb201709f336e7ef5d7d4b179399c5b0d000be6f4a16ecd648e2c9864cf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.16

Release files / rilacs-1.0.3-py3-none-any.whl

Download URL rilacs-1.0.3-py3-none-any.whl
Size 10.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a7a44c813766925d12793d4869865ec661d5166ec0823a59f102077a93cb40bd
BLAKE2b-256 checksum
How to use checksums
777952d26b475a94ca76570fbee1e7d2b62fbab0e0dcfb7cd573b16690514213
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.16

Release history Release notifications | RSS feed

This release

1.0.3 This release

2 release files

1.0.0

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page