fastrerandomize-software

FastRerandomize: An R Package for Ultra-fast Rerandomization Using Accelerated Computing

https://github.com/cjerzak/fastrerandomize-software

Science Score: 36.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
    Links to: arxiv.org
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (14.8%) to scientific vocabulary

Keywords

balance experimental-design hardware-acceleration r
Last synced: 6 months ago · JSON representation

Repository

FastRerandomize: An R Package for Ultra-fast Rerandomization Using Accelerated Computing

Basic Info
Statistics
  • Stars: 8
  • Watchers: 1
  • Forks: 0
  • Open Issues: 9
  • Releases: 0
Topics
balance experimental-design hardware-acceleration r
Created over 2 years ago · Last pushed 8 months ago
Metadata Files
Readme License

README.md

fastrerandomize: An R Package for Ultra-Fast Rerandomization Using Accelerated Computing

What is fastrerandomize? | Installation | Tutorial | Data | CRAN | References | Documentation

Demo Button CRAN Button Website

Tests

Note: fastrerandomize has been successfully tested on CPU, CUDA, and METAL frameworks. Special thanks to Aniket Kamat and Fucheng Warren Zhu for their work on the latest package build!

What is fastrerandomize?

The fastrerandomize contains functions such as randomization_test, which offers a streamlined approach for performing randomization tests after using rerandomization in the research design.

We employ a JAX backend to make exact rerandomization inference possible even for larger experiments where the number of randomizations is in the hundreds of millions or where experimenters seek to maintain balanced randomizations across thousands of features.

Package Installation and Loading

```

Install fastrerandomize stable version from CRAN

install.packages("fastrerandomize")

Install fastrerandomize development version from GitHub

devtools::install_github(repo = "cjerzak/fastrerandomize-software/fastrerandomize")

Load the package

library( fastrerandomize )

Running code the first time, you'll want to create the computational environment

fastrerandomize::build_backend() ```

Tutorial

Let's get started with a tutorial. We're first going to use the package to generate a pool of acceptable rerandomizations. ```

First, specify some analysis parameters

nunits <- 20; ntreated <- 10

Generate covariate data

X <- matrix(rnorm(nunits*5),nrow = nunits)

Generate a set of acceptable randomizations based on randomizationacceptprob.

When randomizationacceptprob = 1, all randomizations are accepted.

When randomizationacceptprob < 1, only well-balanced randomizations are accepted.

When randomizationacceptprob = 1/|Size of cand. randomization set|, 1 randomization is accepted.

candidaterandomizations <- fastrerandomize::generaterandomizations( nunits = nunits, ntreated = ntreated, X = X, randomizationacceptprob = 0.001)

Check out the candidate randomization dimensions

dim( candidate_randomizations ) We can also use `fastrerandomize` to perform a randomization test using those acceptable randomizations.

Setup simulated outcome data

CoefY <- rnorm(ncol(X)) Wobs <- candidaterandomizations[1,] tautrue <- 1 Yobs <- c(X %% as.matrix(CoefY) + Wobstautrue + rnorm(nunits, sd = 0.1))

Perform exact randomization set based on accepted randomizations

ExactRandomizationTestResults <- fastrerandomize::randomizationtest( obsW = Wobs, obsY = Yobs, candidaterandomizations = candidaterandomizations, findFI = F # set to T if an exact fiducial interval needed ) ExactRandomizationTestResults$pvalue # p-value ExactRandomizationTestResults$tau_obs # difference-in-means ATE estimate ```

Replication Data

Replication data for the package is available using the data command. data( QJEData ) data( YOPData )

Development

We welcome new features or bug fixes (you can raise an issue or submit a pull request in the repository). We will keep the package up-to-date with the latest version of the JAX backend.

References

Connor T. Jerzak, Rebecca Goldstein, Aniket Kamat, Fucheng Warren Zhu. fastrerandomize: An R Package for Fast Rerandomization Using Accelerated Computing. ArXiv Preprint, 2025. [PDF] @article{jerzak2025fastrerandomize, title={fastrerandomize: An R Package for Fast Rerandomization Using Accelerated Computing}, author={Jerzak, Connor T. and Rebecca Goldstein and Aniket Kamat and Fucheng Warren Zhu}, journal={ArXiv Preprint}, year={2025} }

Connor T. Jerzak and Rebecca Goldstein. "Degrees of Randomness in Rerandomization Procedures." ArXiv Preprint, 2023. [PDF] @article{JerGol2023, title={Degrees of Randomness in Rerandomization Procedures}, author={Jerzak, Connor T. and Rebecca Goldstein}, journal={ArXiv Preprint}, year={2023}}

_

Package functions

_

Hardware acceleration

_

Key to minimize memory overhead

_

Owner

  • Name: Connor Jerzak
  • Login: cjerzak
  • Kind: user
  • Location: Austin, Texas
  • Company: The University of Texas at Austin

Asst. Prof. at UT Austin. Thinking about the future of AI, quantitative methodology, causal inference, social science+more→arXiv:2206.06417, arXiv:2301.12985

GitHub Events

Total
  • Issues event: 42
  • Watch event: 3
  • Issue comment event: 31
  • Member event: 2
  • Push event: 205
  • Pull request event: 7
  • Create event: 1
Last Year
  • Issues event: 42
  • Watch event: 3
  • Issue comment event: 31
  • Member event: 2
  • Push event: 205
  • Pull request event: 7
  • Create event: 1

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 9
  • Total pull requests: 2
  • Average time to close issues: about 2 months
  • Average time to close pull requests: 1 minute
  • Total issue authors: 2
  • Total pull request authors: 1
  • Average comments per issue: 0.33
  • Average comments per pull request: 0.0
  • Merged pull requests: 2
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 9
  • Pull requests: 2
  • Average time to close issues: about 2 months
  • Average time to close pull requests: 1 minute
  • Issue authors: 2
  • Pull request authors: 1
  • Average comments per issue: 0.33
  • Average comments per pull request: 0.0
  • Merged pull requests: 2
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • WarrenZhu050413 (19)
  • cjerzak (7)
Pull Request Authors
  • WarrenZhu050413 (3)
  • cjerzak (2)
Top Labels
Issue Labels
Pull Request Labels
codex (2)

Packages

  • Total packages: 1
  • Total downloads:
    • cran 184 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 2
  • Total maintainers: 1
cran.r-project.org: fastrerandomize

Hardware-Accelerated Rerandomization for Improved Balance

  • Versions: 2
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 184 Last month
Rankings
Stargazers count: 21.8%
Dependent packages count: 27.4%
Forks count: 29.0%
Dependent repos count: 33.8%
Average: 39.8%
Downloads: 87.0%
Maintainers (1)
Last synced: 6 months ago

Dependencies

fastrerandomize/DESCRIPTION cran
  • R >= 3.3.3 depends
  • reticulate * imports