feasiblesize

Feasible Sample Sizes from Incomplete Design Information

feasiblesize implements the framework in Nakamura (2026), https://doi.org/10.3390/stats9050105. It returns feasible sets, including upper boundaries and empty sets, under declared false negative and false positive requirements. It does not select clinically meaningful effects or rank feasible designs by cost.

This is the R implementation of the article’s Python reference software ssadmiss 0.5.0rc1. Python is not required to install or use the R package.

Installation from a source release

Install the CRAN dependency gmp, then install the supplied source tarball:

install.packages("gmp")
install.packages("feasiblesize_0.1.0.tar.gz", repos = NULL, type = "source")
library(feasiblesize)

Normal example

point <- normal_risks(1:1000)
minimum <- normal_risks(1:1000, rule = "minimum")
range(feasible_sizes(point))    # 25 64
range(feasible_sizes(minimum))  # 39 1000 (declared domain ends at 1000)
directional_evidence(1000, point)

These results concern a prespecified rule, not a loss of information in a larger experiment. An upper feasible boundary does not justify discarding observations.

Bounds with incomplete planning information

b <- normal_size_bounds(1:800, sigma_range = c(0.22, 0.30),
                       d_negligible = 0.02, d_meaningful = 0.05,
                       rule = "minimum")
min(b$inner)  # 619
plot(b)

This uses one common rule, calibrated with sigma = 0.30, throughout the continuous interval. Recalibrating the critical value with each unknown state would evaluate a different family of rules.

size_bounds() handles a complete finite state set. It does not certify an unexamined continuous state set from a grid.

Exact binary calculation

cpt <- binary_compatibility(binary_mass(rep("1/4", 4)))
p <- rational_polynomial(c("1/2", 2L))
result <- coordinate_feasibility(cpt, list(
    risk_constraint("fn", "false_negative", 1L-p, "3/4"),
    risk_constraint("fp", "false_positive", p, "3/4")))
result  # feasible coordinates: [-1/8, 1/8]

Use character strings for exact decimal or rational inputs. The package uses gmp rational arithmetic and Sturm sequences; a finite grid is not substituted for full interval verification. Exactness applies to supplied rational inputs and constraint polynomials, not to the estimation of planning inputs.

See vignette("feasible-designs", package = "feasiblesize") for rule family classification, the paired binary example, and computational scope.