4. Coding project 2#

4.1. Contributing to an open source package: implementing new functionality#

This project continues the first coding assignment.

There are many nonparametric tests and confidence procedures not yet in permute, for instance:

  • tests and confidence intervals/sequences for bounded means using betting martingales, for a variety of betting strategies; ALPHA

  • tests and confidence intervals for the treatment effect for binary treatment and binary outcomes: Li and Ding or Aronow et al. See causal inference.

  • tests and confidence sets for percentiles of the treatment effect for bounded outcomes (Caughey et al.)

  • exact tests and confidence intervals for the mean from stratified samples, including methods based on greedy discrete optimization and on supermartingales, \(E\)-values, and union-intersection tests.

  • Gaffke’s bound

  • Romano’s projection of the empirical approach to testing nonparametric hypotheses, including symmetry, exchangeability, and independence

  • Optimally short two-sided confidence bounds for the binomial \(p\) and hypergeometric \(G\) (see confidence sets).

Code up one of those, or some other nonparametric method from the course that is not yet implemented in permute. Make sure the calling signature of your function is parallel to that of similar functions in the package. Make sure the function has the right level of abstraction, and that you provide implementations of a number of sub-functions if that is warranted. For instance, for methods based on betting martingales, you should implement a number of betting strategies; for the ALPHA approach, you should implement a number of “estimators.” If the method can be computed exactly in some circumstances but needs to be approximated/simulated/randomized in others, provide both options. Document your function. Write unit tests that cover its functionality completely. When you’re satisfied that it’s correct, complete, tidy, and well documented, make a pull request to the project.