Learn R Programming

fastrerandomize (version 0.3)

Hardware-Accelerated Rerandomization for Improved Balance

Description

Provides hardware-accelerated tools for performing rerandomization and randomization testing in experimental research. Using a 'JAX' backend, the package enables exact rerandomization inference even for large experiments with hundreds of billions of possible randomizations. Key functionalities include generating pools of acceptable rerandomizations based on covariate balance, conducting exact randomization tests, and performing pre-analysis evaluations to determine optimal rerandomization acceptance thresholds. The package supports various hardware acceleration frameworks including 'CPU', 'CUDA', and 'METAL', making it versatile across accelerated computing environments. This allows researchers to efficiently implement stringent rerandomization designs and conduct valid inference even with large sample sizes. The package is partly based on Jerzak and Goldstein (2023) .

Copy Link

Version

Install

install.packages('fastrerandomize')

Monthly Downloads

159

Version

0.3

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Connor Jerzak

Last Published

December 22nd, 2025

Functions in fastrerandomize (0.3)

generate_randomizations_mc

Draws a random sample of acceptable randomizations from all possible complete randomizations using Monte Carlo sampling
hotellingT2_R

Compute Hotelling's T-squared statistic in base R
summary.fastrerandomize_test

Summary method for fastrerandomize_test objects
print2

Print timestamped messages with optional quieting
randomization_test

Fast randomization test
generate_randomizations

Generate randomizations for a rerandomization-based experimental design
summary.fastrerandomize_randomizations

Summary method for fastrerandomize_randomizations objects
randomization_test_R

Base R randomization test: difference in means + optional fiducial interval
YOPData

YOPData
build_backend

A function to build the environment for fastrerandomize. Builds a conda environment in which 'JAX' and 'np' are installed. Users can also create a conda environment where 'JAX' and 'np' are installed themselves.
QJEData

QJEData: Agricultural Treatment Experiment Data
diff_in_means_R

Simple difference in means in base R
fastrerandomize_test

Constructor for fastrerandomize randomization test objects
fastrerandomize_class

Constructor for fastrerandomize randomizations
compute_diff_at_tau_for_oneW_R

Compute potential outcome difference in means for a single assignment under a hypothesized tau in base R
diagnose_rerandomization

Diagnostic map from observed (or targeted) balance to precision and stringency
check_jax_availability

Check if 'Python' and 'JAX' are available
fast_distance

JAX-accelerated distance calculations
generate_randomizations_R

Generate randomizations in base R, filtering by Hotelling's T^2 acceptance
generate_randomizations_exact

Generate Complete Randomizations with Optional Balance Constraints
plot.fastrerandomize_test

Plot method for fastrerandomize_test objects
plot.fastrerandomize_randomizations

Plot method for fastrerandomize_randomizations objects
find_fiducial_interval_R

Fiducial interval logic in base R, for randomization test
print.fastrerandomize_test

Print method for fastrerandomize_test objects
print.fastrerandomize_randomizations

Print method for fastrerandomize_randomizations objects