EDI v1.0.4 Exhaustive C++ Model Fit Benchmarks

Generated: 2026-11-08 06:32:54 IST

R analog of benchmark_model_fits_python.html — the first three tables share its table shape and three-color row coding; the inference-procedure and design-generation tables are R-only.

Selected sections: models, wald, utility, procedures, designs

This report compares the performance of EDI's Rcpp-optimized model fitting paths against low-level canonical R implementations (e.g., glm.fit, lm.fit, coxph.fit) where possible.

Compilation Context

These rows are read from build metadata compiled into the loaded EDI shared object via edi_build_info_cpp().

Compilation warning: EDI model-fit timings are sensitive to the compiler flags used to build the loaded EDI.so. If EDI is compiled without the proper optimized flags, or with flags that are known to degrade these kernels such as problematic LTO builds, the benchmark can show substantial performance regressions that reflect the binary build rather than the modeling algorithms.

Default install vs. this build: every standard install of EDI (CRAN, R-universe, or GitHub source) uses the portable build (EDI_PORTABLE=1, no -march=native/-mtune=native or -O3 override), so results match across platforms. The timings below come from the build listed in this section; when it shows EDI_PORTABLE=0, they are from the opt-in tuned build described in the README's "Tuning Local Builds" section, and a default install may run slower.

Benchmark Dataset Specification

All benchmarks were performed on a synthetic clinical-trial-scale dataset generated for each response type. The data generation process ensures numerical stability and fair solver comparison by using the following parameters:

Methodology

Results

EDI faster, significant   EDI slower, significant   NA timing comparison   no canonical R implementation

ClassResponseEDI Time (ms)Canonical PkgCanonical FuncCanonical Time (ms)SpeedupTiming PvalEDI IterationsCanonical Iterations
InferenceAllSimpleWilcoxcontinuous0.18statsHL median pairwise diff1.176.41x1.2e-21***NANA
InferenceContinGLMM (pairs)continuous0.10lme4lmer(ML)13.29127.22x4.16e-44***9NA
InferenceContinGLMM (pairs)continuous0.11glmmTMBglmmTMB(gaussian)82.00774.77x4e-51***9NA
InferenceContinOLScontinuous0.01statslm.fit0.076.29x8.25e-25***NANA
InferenceContinQuantileRegrcontinuous0.88quantregrq.fit0.881x0.381NANA
InferenceContinRobustRegrcontinuous0.09MASSrlm(MM)39.00425.26x6.7e-49***8NA
InferenceContinRobustRegrcontinuous0.09robustbaselmrob.fit(MM)28.37302.97x4.58e-53***89
InferenceIncidBinomialIdentityRiskDiffincidence0.21statsglm.fit(ident)1.075.03x8.8e-26***54
InferenceIncidGCompRiskDiffincidence0.16statsglm.fit+gcomp(RD)1.278.15x8.79e-25***NANA
InferenceIncidGCompRiskRatioincidence0.18statsglm.fit+gcomp(RR)1.287.15x8.16e-23***NANA
InferenceIncidKKCondLogitGLMMOneLikincidence5.92Noneno canonical R implementationNANANA6NA
InferenceIncidLogBinomialincidence0.34statsglm.fit(log)1.454.21x9.47e-25***84
InferenceIncidLogRegrincidence0.14statsglm.fit1.178.5x1.17e-23***54
InferenceIncidModifiedPoissonincidence0.11statsglm.fit(modified)1.5714.24x1.44e-26***55
InferenceIncidProbitRegrincidence0.31statsglm.fit(probit)1.504.77x6.71e-31***74
InferenceIncidRiskDiffincidence0.01statslm.fit(LPM)0.086.46x5.05e-26***NANA
fast_logistic_glmm_cpp (pairs, kernel only)incidence31.21lme4glmer(binomial, nAGQ=20)300.509.63x5.67e-53***13NA
fast_logistic_glmm_cpp (pairs, kernel only)incidence31.00glmmTMBglmmTMB(binomial)113.503.66x1.4e-48***13NA
InferenceCountGLMM (pairs)count46.60lme4glmer(poisson, nAGQ=20)277.505.95x1.03e-46***21NA
InferenceCountGLMM (pairs)count46.90glmmTMBglmmTMB(poisson)111.502.38x1.06e-47***21NA
InferenceCountHurdleNegBincount1.05psclhurdle(nb)37.0035.23x1.17e-29***21NA
InferenceCountHurdlePoissoncount2.86psclhurdle19.676.87x1.67e-23***64NA
InferenceCountHurdlePoisson (pairs)count2.09glmmTMBglmmTMB(truncated_poisson, zi RE)379.00180.93x3.23e-48***20NA
InferenceCountKKCondPoissonOneLikcount0.05Noneno canonical R implementationNANANA5NA
InferenceCountNegBincount0.49MASSglm.nb11.4523.6x3.27e-31***241
InferenceCountPoissoncount0.11statsglm.fit1.4813.52x4.91e-29***65
InferenceCountQuasiPoissoncount0.13statsglm.fit(quasi)1.3810.43x6.63e-27***75
InferenceCountRobustPoissoncount0.14statsglm.fit1.5211.06x2.55e-27***65
InferenceCountZeroInflatedNegBincount10.05psclzeroinfl(nb)345.0034.33x1.98e-32***4335
InferenceCountZeroInflatedPoissoncount2.88psclzeroinfl164.5057.11x1.42e-32***79183
InferencePropBetaRegrproportion0.88betaregbetareg.fit24.8528.38x1.21e-46***714
InferencePropFractionalLogitproportion0.14statsglm.fit(quasi)1.097.79x2.6e-28***54
InferencePropGCompMeanDiffproportion0.18statsglm.fit(quasi)+gcomp1.196.62x8.48e-16***NANA
InferencePropZeroOneInflatedBetaRegrproportion2.64gamlssgamlss(BEINF)77.8329.44x3.64e-29***234
InferenceSurvivalCoxPHRegrsurvival0.31survivalcoxph.fit(breslow)0.501.58x2.54e-42***44
InferenceSurvivalGLMMWeibullFrailtyNormalOneLiksurvival1.49parfmparfm(weibull, lognormal)14353.009612.56x1.29e-09***7NA
InferenceSurvivalKMDiffsurvival0.01survivalsurvfit(median)2.79233.6x2.05e-35***NANA
InferenceSurvivalLogRanksurvival0.03survivalsurvdiff1.5649.07x7.14e-51***NANA
InferenceSurvivalRestrictedMeanDiffsurvival0.01survivalsurvfit(rmean)2.14166.3x1.73e-34***NANA
InferenceSurvivalStratCoxPHRegrsurvival0.54survivalcoxph.fit(strat)0.631.17x1.17e-15***43
InferenceSurvivalWeibullRegrsurvival0.15survivalsurvreg2.8418.76x1.05e-29***106
InferenceSurvivalWeibullRegr (interval-censored)survival0.36survivalsurvreg(interval2)3.289.03x3.12e-29***95
InferenceSurvivalWeibullRegr (interval-censored)survival0.37icenRegic_par(aft, weibull)13.6837.17x2.14e-44***9NA
InferenceOrdinalAdjCatLogitRegrordinal0.84VGAMvglm(acat)11.2113.28x6.94e-28***105
InferenceOrdinalCLMM (pairs)ordinal69.00ordinalclmm(nAGQ=20)665.509.64x4.93e-49***40NA
InferenceOrdinalCauchitRegrordinal0.54ordinalclm(cauchit)7.1513.21x1.65e-29***107
InferenceOrdinalCloglogRegrordinal0.49ordinalclm(cloglog)5.9712.14x1.21e-28***85
InferenceOrdinalContRatioRegrordinal0.19VGAMvglm(cratio)10.3355.08x1.36e-31***95
InferenceOrdinalGCompMeanDiffordinal0.49ordinalclm+gcomp10.6821.57x5.32e-29***NANA
InferenceOrdinalGLMM (pairs)ordinal139.00ordinalclmm(nAGQ=20)932.006.71x1.75e-52***39NA
InferenceOrdinalOrderedProbitRegrordinal0.42ordinalclm(probit)5.3812.73x1.3e-29***74
InferenceOrdinalPropOddsRegrordinal0.46ordinalclm5.3811.78x2.3e-29***84

Wald Test Performance (Full Inference)

This table compares the performance of Full Inference (Model Fit + Standard Error calculation + P-value derivation). Unlike the point-estimation table above, these results include the computational cost of the variance-covariance matrix (Hessian or Fisher Information) and the Wald test statistic calculation. All paths (EDI and Canonical) use a reduced sample size ($N=200$) for this full-inference benchmark to ensure iterative stability. Stratified Cox Exception: For InferenceSurvivalStratCoxPHRegr, the benchmark injects low-cardinality covariates before outcome generation so the row exercises a genuinely stratified Cox fit rather than the unstratified fallback. EDI regression models (Logistic, Poisson) are benchmarked using the IRLS optimizer for these Wald tests. Solver-Only Prebuilds: Benchmark setup prebuilds exposed observed-data design matrices, reduced design matrices, strata IDs, and other fixed working inputs outside the timed region when the implementation exposes those hooks. The timed region then measures the full-inference kernel on those fixed inputs. Limitation: Some canonical comparators only expose formula-based APIs rather than comparable low-level fit kernels. Those rows remain included, but their canonical timings may still contain formula/model-frame overhead beyond the numerical solver, variance, and p-value work itself. Timing Note: All timings are medians over 30 warmed runs measured with adaptive batched system.time; paths below 0.01 ms use microbenchmark(times = 5000) instead. Timing P-Value: Timing Pval reports a Welch two-sample t-test comparing the EDI and canonical timing replicate distributions for each row. The unlabeled final column marks thresholds with *** for p < 0.001, ** for p < 0.01, and * for p < 0.05. Row Highlighting: Light green rows indicate Speedup > 1 and Timing Pval < 0.05; light red rows indicate significant Speedup < 1; light grey rows indicate NA timing comparisons from a failed fit; light blue rows are estimators with no canonical R implementation at all (only EDI is timed, Canonical Time/Speedup/Timing Pval are NA by design).

EDI faster, significant   EDI slower, significant   NA timing comparison   no canonical R implementation

ClassResponseEDI Time (ms)Canonical PkgCanonical FuncCanonical Time (ms)SpeedupTiming PvalEDI IterationsCanonical Iterations
InferenceAllSimpleAverageDiffcontinuous0.03estimatrdifference_in_means1.7368.78x1.21e-45***NANA
InferenceAllSimpleMeanDiffPooledVarcontinuous0.02statst.test(pool)0.093.65x1.51e-24***NANA
InferenceAllSimpleWilcoxcontinuous0.05statswilcox.test0.488.87x3.85e-49***NANA
InferenceContinGLMM (pairs)continuous0.09lme4lmer(ML)+Wald14.25152.05x1.15e-43***NANA
InferenceContinGLMM (pairs)continuous0.09glmmTMBglmmTMB(gaussian)+Wald60.50648.78x5.84e-42***NANA
InferenceContinLincontinuous0.13statslm.fit(interact)+Wald0.352.8x4.8e-59***NANA
InferenceContinLincontinuous0.13estimatrlm_lin(HC2)2.2617.85x2.8e-39***NANA
InferenceContinOLScontinuous0.01statslm.fit+Wald0.053.58x8.48e-61***NANA
InferenceContinOLScontinuous0.01estimatrlm_robust(classical)1.68113.38x3.01e-27***NANA
InferenceContinQuantileRegrcontinuous1.44quantregrq+summary1.501.04x0.023*NANA
InferenceContinRobustRegrcontinuous0.05MASSrlm+summary1.0823.98x6.9e-41***10NA
InferenceContinRobustRegrcontinuous0.04robustbaselmrob+summary8.25186.75x2.28e-42***10NA
InferenceIncidExactFisherincidence0.58statsfisher.test0.661.14x1.03e-06***NANA
InferenceIncidGCompRiskDiffincidence0.06statsglm+gcomp(RD)+Wald1.4622.71x4.52e-43***NANA
InferenceIncidGCompRiskRatioincidence0.06statsglm+gcomp(RR)+Wald1.4524.24x2.13e-26***NANA
InferenceIncidKKCondLogitGLMMOneLikincidence4.38Noneno canonical R implementationNANANANANA
InferenceIncidLogBinomialincidence0.28statsglm.fit+Wald(log)1.816.44x4.45e-27***24NA
InferenceIncidLogRegrincidence0.06statsglm.fit+Wald0.6210.56x7.73e-28***6NA
InferenceIncidMiettinenNurminenRiskDiffincidence6.80e-03DescToolsBinomDiffCI(mn)0.4465.02xNANANA
InferenceIncidNewcombeRiskDiffincidence0.06DescToolsBinomDiffCI(score)0.549.61x1.58e-27***NANA
InferenceIncidProbitRegrincidence0.10statsglm.fit(probit)+Wald0.808.1x1.79e-39***9NA
InferenceIncidRiskDiffincidence0.01statsprop.test0.3221.7x6.5e-52***NANA
fast_logistic_glmm_cpp (pairs, kernel only)incidence12.53lme4glmer(binomial, nAGQ=20)+Wald181.0014.44x2.6e-33***NANA
fast_logistic_glmm_cpp (pairs, kernel only)incidence13.37glmmTMBglmmTMB(binomial)+Wald66.004.93x2.39e-39***NANA
InferenceCountGLMM (pairs)count10.37lme4glmer(poisson, nAGQ=20)+Wald113.7510.97x1.16e-49***NANA
InferenceCountGLMM (pairs)count10.60glmmTMBglmmTMB(poisson)+Wald78.837.44x2.34e-33***NANA
InferenceCountHurdleNegBincount0.24psclhurdle(nb)+summary8.5236.11x6.66e-28***20NA
InferenceCountHurdlePoissoncount0.31psclhurdle+summary7.0022.57x2.36e-37***23NA
InferenceCountHurdlePoisson (pairs)count0.91glmmTMBglmmTMB(truncated_poisson, zi RE)+Wald184.75203.8x3.94e-47***NANA
InferenceCountKKCondPoissonOneLikcount0.04Noneno canonical R implementationNANANANANA
InferenceCountNegBincount0.13MASSglm.nb+summary10.2178.86x1.77e-50***12NA
InferenceCountPoissoncount0.06statsglm.fit+Wald0.6910.7x4.53e-28***7NA
InferenceCountQuasiPoissoncount0.06statsglm.fit+Wald(quasi)0.6611.37x4.2e-48***6NA
InferenceCountRobustPoissoncount0.10sandwichglm+vcovHC2.7928.75x8.23e-27***7NA
InferenceCountZeroInflatedNegBincount0.89psclzeroinfl(nb)+summary23.5026.47x4.47e-52***NANA
InferenceCountZeroInflatedPoissoncount0.32psclzeroinfl+summary15.9250.08x2.37e-28***33NA
InferencePropBetaRegrproportion0.24betaregbetareg+summary11.8248.89x3.28e-48***8NA
InferencePropGCompMeanDiffproportion0.06statsglm(quasi)+gcomp+Wald1.4923.06x1.74e-45***NANA
InferencePropZeroOneInflatedBetaRegrproportion0.63gamlssgamlss(BEINF)+Wald151.50240.91x4.64e-46***NANA
InferenceSurvivalCoxPHRegrsurvival0.13survivalcoxph.fit(breslow)+Wald0.362.77x1.37e-48***4NA
InferenceSurvivalGLMMWeibullFrailtyNormalOneLiksurvival1.13parfmparfm(weibull, lognormal)+Wald4715.004154.8x8.36e-09***NANA
InferenceSurvivalGehanWilcoxsurvival0.02survivalsurvdiff(rho=1)1.2275.35x3.38e-44***NANA
InferenceSurvivalKMDiffsurvival2.33survivalsurvfit(median)+CI2.441.05x0.0111*NANA
InferenceSurvivalLogRanksurvival0.12survivalsurvdiff2.8823.64x3.37e-25***NANA
InferenceSurvivalStratCoxPHRegrsurvival0.39survivalcoxph.fit(strat)+Wald0.511.3x2.97e-34***4NA
InferenceSurvivalWeibullRegrsurvival0.11survivalsurvreg+summary2.4021.31x4.07e-38***9NA
InferenceSurvivalWeibullRegr (interval-censored)survival0.19survivalsurvreg(interval2)+summary2.5213.05x1.84e-26***NANA
InferenceSurvivalWeibullRegr (interval-censored)survival0.20icenRegic_par(aft)+Wald7.5037.79x5.64e-38***NANA
InferenceOrdinalAdjCatLogitRegrordinal0.21VGAMvglm+summary9.9347.35x5.55e-26***9NA
InferenceOrdinalCLMM (pairs)ordinal23.38ordinalclmm(nAGQ=20)+Wald157.506.74x6.24e-46***NANA
InferenceOrdinalContRatioRegrordinal0.06VGAMvglm+summary9.21150.34x1.59e-39***8NA
InferenceOrdinalGCompMeanDiffordinal0.26ordinalclm+gcomp+Wald4.7618.27x2.35e-44***NANA
InferenceOrdinalGLMM (pairs)ordinal28.14ordinalclmm(nAGQ=20)+Wald159.505.67x3.05e-51***NANA
InferenceOrdinalJonckheereTerpstraTestordinal0.13clinfunjonckheere0.987.77x3.99e-49***NANA
InferenceOrdinalPropOddsRegrordinal0.14ordinalclm+summary3.5925.69x3.42e-45***8NA
InferenceOrdinalRiditordinal0.06statsmean(ridit)0.264.63x2.95e-25***NANA

Garbage Collection and Cache Management

To ensure that the benchmark results are highly precise, reproducible, and represent the actual computation speed of the numerical solvers, the benchmarking harness uses the following garbage collection and cache management strategies:

1. Garbage Collection (GC) Filtering

Garbage collection cycles run automatically by the R interpreter and can introduce significant, arbitrary pauses that skew timing measurements. To isolate the execution time of the code from R's GC overhead:

2. Cold-Start Guarantee for EDI and Symmetric Warm-Up for Both Sides

Both EDI and canonical timing expressions receive a single validation/warm-up call executed once before the calibration loop begins. This puts the machine code and working data into the instruction and data caches in the same warmed state for both sides, so the official timed replicates start on equal footing.

EDI timings call exported C++ functions directly — no R6 objects are instantiated during benchmarking. As a result, no R6 result caches exist to manage. Each call to the C++ solver (e.g. fast_logistic_regression_cpp, fast_ordinal_regression_cpp) starts from a freshly zero-initialized parameter vector (or a model-specific data-driven initialization when smart_cold_start = TRUE). No prior-fit results are carried across timing repetitions, so every replication is a genuine cold start for the numerical optimizer.

Utility / Math Kernel Performance

This table is an exhaustive inventory of every fast_* scalar math kernel in EDI/src — used inside the NegBin/Beta/ZINB/Hurdle likelihoods, KK21 negative-binomial fitting, probit cold-start heuristics, ordinal cloglog/cauchit link derivatives, and LRT/score-test p-values — against base R's vectorized equivalents. Unlike the model-fit tables above, these are not full estimators: each row is a single vectorized special-function evaluation (digamma, trigamma, log-gamma, log-beta, error function, normal CDF/PDF/quantile (both closed-form and log-scale), chi-squared upper-tail p-value, arctangent, softplus, and the mu-parameterized negative-binomial density) over a fixed-length vector, with no design matrix, optimizer, or R6 object involved on either side. Vector length: All rows evaluate the function over a vector of length $N=5000$; inputs are drawn from a domain realistic for each kernel's actual call sites in EDI (e.g. shape/rate-like values in $(0.5, 50)$ for digamma/trigamma/lgamma, probabilities in $(0, 1)$ for qnorm). Bare Metal EDI Timing: Eight kernels (digamma, trigamma, lgamma, lbeta, dnbinom_mu, qnorm, log_pnorm, log_dnorm) call the package's own exported fast_*_vec_cpp wrapper (EDI/src/fast_math_utils.cpp, documented and exported via roxygen/NAMESPACE like any other EDI function) directly from the installed package — no separate compile step. The remaining six (pchisq_upper, erfc, pnorm_fast, dnorm_fast, atan, log1pexp) aren't promoted to package exports yet, so those rows call a thin bare-metal wrapper compiled standalone via Rcpp::sourceCpp() against the same EDI/src leaf headers (benchmark/fast_math_utils_bench.cpp) — same convention as benchmark/fast_trigamma_speed_compare.cpp. Either way, the wrapper just loops the internal fast_* scalar kernel over the input vector — no R6, no caching, no warm starts. Canonical R Timing: The base R column calls the corresponding vectorized base/stats function directly on the same input vector (e.g. digamma(), lgamma(), stats::qnorm(), stats::dnbinom(..., mu = , log = TRUE)). Timing Note: All timings use the same adaptive batched system.time/microbenchmark harness as the tables above (medians over 30 cold samples; paths below 0.01 ms fall back to microbenchmark(times = 5000)). Timing P-Value: Timing Pval reports a Welch two-sample t-test comparing the EDI and base R timing replicate distributions for each row. The unlabeled final column marks thresholds with *** for p < 0.001, ** for p < 0.01, and * for p < 0.05. Row Highlighting: Light green rows indicate Speedup > 1 and Timing Pval < 0.05; light red rows indicate significant Speedup < 1; light grey rows indicate NA timing comparisons from a failed evaluation.

EDI faster, significant   EDI slower, significant   NA timing comparison   no canonical R implementation

FunctionResponseEDI Time (ms)Canonical PkgCanonical FuncCanonical Time (ms)SpeedupTiming Pval
dnorm_fastutility0.04base/statsdnorm0.092.37x3.29e-35***
fast_atanutility0.03base/statsatan0.071.95x2.82e-21***
fast_digammautility0.05base/statsdigamma0.305.64x2.52e-67***
fast_dnbinom_muutility0.36base/statsdnbinom(mu=, log=TRUE)0.451.27x1.07e-12***
fast_erfcutility0.07base/stats2*pnorm(-x*sqrt(2))0.253.45x2.36e-43***
fast_lbetautility0.19base/statslbeta0.412.14x1.88e-72***
fast_lgammautility0.06base/statslgamma0.111.77x2.73e-19***
fast_log1pexputility0.07base/statslog1p(exp(x))0.091.33x4.44e-13***
fast_log_dnormutility0.01base/statsdnorm(log=TRUE)0.064.61x5.97e-45***
fast_log_pnormutility0.10base/statspnorm(log.p=TRUE)0.242.34x8.68e-49***
fast_pchisq_upperutility0.52base/statspchisq(lower.tail=FALSE)0.701.35x2.4e-39***
fast_qnormutility0.03base/statsqnorm0.082.43x2.18e-21***
fast_trigammautility0.03base/statstrigamma0.4316.11x1.08e-57***
pnorm_fastutility0.07base/statspnorm0.223.25x4.41e-54***

Resampling-Based Inference Procedure Performance

This table times complete inference procedures rather than single model fits: randomization-test p-values and randomization confidence intervals, nonparametric bootstrap confidence intervals, and exact 2x2 inference, each against the dedicated R package for that procedure (ri2, coin, perm, boot, stats::fisher.test). Data: one completed DesignFixediBCRD design per response type with $N=1000$ subjects (500 for the Cox row), a balanced binary treatment and 4 standard-normal covariates, generated by the same generate_data() as the model-fit tables; the exact-CI row uses a DesignFixedBernoulli design because InferenceIncidExactZhang requires Bernoulli or matching designs. All resampling rows use $r=1000$ randomizations or $B=1000$ (OLS) / $B=500$ (logistic, Cox) bootstrap draws on both sides. [R6 ...] rows report EDI Total (ms), EDI Construction (ms), and EDI Procedure (ms). Total preserves the public path (InferenceXxx$new(des) plus compute_rand_two_sided_pval(), compute_rand_confidence_interval(), compute_bootstrap_confidence_interval(), or compute_exact_confidence_interval()); construction is measured separately. For procedure samples, the harness constructs a fresh configured inference object immediately before, but outside, each timed batch. This prevents a repeated call from becoming a cache hit without adding a benchmark-only public cache-reset API. Speedup and Timing Pval compare the procedure column with the canonical timing. Kernel rows have no R6 construction, so their construction cell is — and procedure equals total. The completed Design is built once outside every inference measurement. Canonical rows include their own model-frame/object construction (conduct_ri(), oneway_test(), boot()), so both sides pay comparable setup. Both sides run single-threaded (num_cores = 1); EDI's resampling methods can additionally fan out across cores, which is not exercised here. [kernel ...] rows call the exported C++ kernel directly on prebuilt matrices, including the permutation / bootstrap-index generation (coin, ri2 and boot draw theirs inside the timed call too). compute_simple_mean_diff_parallel_cpp is the kernel InferenceAllSimpleAverageDiff's randomization test runs on, so its [kernel] and [R6] rows bracket the R6 overhead. The two OLS kernels (compute_ols_distr_parallel_cpp, compute_ols_bootstrap_parallel_cpp) are compiled into the package but are not currently called by any R6 class (InferenceContinOLS resamples through the generic reused-worker path), so those rows show attainable rather than currently delivered speed; they are labelled accordingly. Bootstrap CIs are percentile intervals on both sides (type = "percentile" in EDI, boot.ci(type = "perc")). EDI's default type = "bca" additionally runs a full leave-one-out jackknife for the acceleration constant, which roughly doubles its cost at these sizes and has no boot counterpart without a user-supplied jackknife. Randomization CIs (test inversion by bisection over the sharp-null shift) have no canonical R implementation (ri2, coin and perm return p-values only), so those rows are light blue with EDI timed alone. Exact 2x2 inference: EDI implements Fisher's conditional exact test only. InferenceIncidExactFisher wraps stats::fisher.test() directly (its full-inference row is in the Wald table above); InferenceIncidExactZhang evaluates the same conditional p-value through EDI's own C++ kernel zhang_exact_fisher_pval_cpp (timed here against fisher.test()) and inverts it for its exact confidence interval, which is compared against fisher.test()'s conditional-MLE interval. EDI has no unconditional exact test (Barnard / Boschloo), so Exact::exact.test() is deliberately not timed: a comparison would be between different tests. Not timed: zoib (Bayesian zero-one-inflated beta via JAGS MCMC) in the model-fit tables, for the same like-for-like reason. Timing Note: medians over 10 warmed runs (5 for the two randomization-CI rows) with the same adaptive batched system.time harness as the tables above; Welch t-test Timing Pval and row colouring as above.

EDI faster, significant   EDI slower, significant   NA timing comparison   no canonical R implementation

ProcedureResponseEDI Total (ms)EDI Construction (ms)EDI Procedure (ms)Canonical PkgCanonical FuncCanonical Time (ms)SpeedupTiming Pval
Randomization test p-value: mean difference (r = 1000) [kernel]continuous4.71—4.71coinoneway_test(approximate)9.872.1x3.32e-08***
Randomization test p-value: mean difference (r = 1000) [kernel]continuous4.42—4.42permpermTS(exact.mc)34.837.88x7.43e-15***
Randomization test p-value: mean difference (r = 1000) [kernel]continuous4.46—4.46ri2conduct_ri(sims)967.50217.01x2.99e-19***
Randomization test p-value: mean difference (r = 1000) [R6 InferenceAllSimpleAverageDiff]continuous33.291.3531.08coinoneway_test(approximate)9.840.32x3.24e-05***
Randomization test p-value: mean difference (r = 1000) [R6 InferenceAllSimpleAverageDiff]continuous34.871.3831.17ri2conduct_ri(sims)957.0030.71x7.15e-13***
Randomization test p-value: OLS covariate-adjusted (r = 1000) [kernel, not wired to an R6 class]continuous7.06—7.06ri2conduct_ri(y ~ Z + X, sims)1016.00143.82x4.63e-11***
Randomization test p-value: OLS covariate-adjusted (r = 1000) [R6 InferenceContinOLS]continuous43.301.6337.70ri2conduct_ri(y ~ Z + X, sims)1002.0026.58x3.19e-13***
Randomization CI: mean difference (r = 1000, test inversion) [R6 InferenceAllSimpleAverageDiff]continuous108.001.46106.00Noneno canonical R implementationNANANA
Randomization CI: OLS covariate-adjusted (r = 1000, test inversion) [R6 InferenceContinOLS]continuous107.501.75105.00Noneno canonical R implementationNANANA
Nonparametric bootstrap CI: OLS (B = 1000) [kernel, not wired to an R6 class]continuous17.23—17.23bootboot(lm.fit)+boot.ci(perc)119.506.94x1.06e-20***
Nonparametric bootstrap CI: OLS (B = 1000) [R6 InferenceContinOLS]continuous1105.501.741471.50bootboot(lm.fit)+boot.ci(perc)120.500.082x3.01e-08***
Nonparametric bootstrap CI: logistic regression (B = 500) [R6 InferenceIncidLogRegr]incidence526.002.13491.50bootboot(glm.fit)+boot.ci(perc)608.501.24x0.316
Nonparametric bootstrap CI: Cox PH (B = 500, n = 500) [R6 InferenceSurvivalCoxPHRegr]survival476.501.75477.00bootboot(coxph.fit)+boot.ci(perc)211.000.44x6.21e-19***
Exact Fisher 2x2 p-value (n = 1000) [kernel zhang_exact_fisher_pval_cpp]incidence0.07—0.07statsfisher.test0.8912.56x2.51e-17***
Exact CI for the log odds ratio (n = 1000, test inversion) [R6 InferenceIncidExactZhang]incidence4.220.843.38statsfisher.test(conf.int)0.720.21x7.06e-19***

Design Generation Performance

This table times the production of one complete treatment allocation for $N=1000$ subjects, from covariate ingestion to the assignment vector, against the dedicated randomization packages (randomizr, nbpMatching, blockTools, carat, Minirand). EDI Total (ms) is the public end-to-end path; EDI Construction (ms) is Design$new() plus fixed-design covariate ingestion (or only construction for the sequential design); EDI Procedure (ms) is assignment, including the 1000 sequential arrivals where applicable. Speedup and Timing Pval use procedure time. Canonical rows receive their covariate table or block ids prebuilt. Fixtures: two factor covariates (3 and 2 levels, i.e. 6 strata) for the blocking and Pocock-Simon rows, four standard-normal covariates for the matching rows. Honest labelling:

EDI faster, significant   EDI slower, significant   NA timing comparison   no canonical R implementation

DesignResponseEDI Total (ms)EDI Construction (ms)EDI Procedure (ms)Canonical PkgCanonical FuncCanonical Time (ms)SpeedupTiming Pval
DesignFixediBCRD: complete randomization (n = 1000)design0.810.770.04randomizrcomplete_ra0.082.22x1.02e-13***
DesignFixedBlocking: strata from 2 factor covariates (6 blocks), n = 1000design1.450.770.66randomizrblock_ra(blocks precomputed)0.450.68x8.36e-17***
DesignFixedBinaryMatch: Mahalanobis optimal pairs + within-pair randomization (4 covariates, n = 1000)design239.000.77238.50nbpMatchinggendistance+nonbimatch+coin flips326.001.37x0.00129**
DesignFixedBinaryMatch: Mahalanobis optimal pairs + within-pair randomization (4 covariates, n = 1000)design240.500.78246.50blockToolsblock(n.tr=2, optGreedy)+assignment251.501.02x0.0678
DesignSeqOneByOnePocockSimon: 1000 sequential arrivals, 2 factor covariates, p_best = 0.8design224.000.55227.00caratPocSimMIN(p = 0.8)3.250.014x4.89e-14***
DesignSeqOneByOnePocockSimon: 1000 sequential arrivals, 2 factor covariates, p_best = 0.8design226.500.55234.00MinirandMinirand(Range, p = 0.8) loop689.502.95x5.32e-25***