iRBCrd 2.1 -- Verification, October 29, 2026

Method reference: Cavaliere, Goncalves, Nielsen, and Zanelli (2026),
Improved Inference for Nonparametric Regression and Regression-Discontinuity
Designs, https://arxiv.org/abs/2512.00566.
Runtime: R 4.5.2, macOS. Optional comparison package: rdrobust 3.0.0.

KINK FORMULA CHECKS
------------------
kink_test.R passes 1002 numerical and error-handling assertions with rdrobust
installed. Its core formulas are also tested without any additional packages.

- Independent weighted-least-squares coefficient matrices, not the estimator's
  helper routines, reproduce raw slopes, finite-sample Q, bias corrections,
  residuals, analytic variances, and conditional bootstrap variances.
- Three kernels, p = 1, 2, 3, and all CCT-HC0:HC3 and iRBC-HC0:HC3 choices.
- Corrected coefficient maps reproduce slope moments through p+1.
- Full joint regressions verify common covariate coefficients with unequal
  bandwidths, including both equations of adjusted fuzzy kink RD.
- Joint covariance and linearized-ratio corrections checked in all designs.
- Explicit bootstrap data generation and brute-force cutoff refits reproduce
  saved component draws and combined statistics in all four kink designs.
- Sampled bootstrap quantiles and their prepivoting probabilities checked.
- Population Q agrees across 48- and 96-node quadrature for p = 1 through 5,
  and agrees with dense finite designs within the stated numerical tolerances.
- Local linear equivalent-kernel length ratios reproduce the triangular,
  Epanechnikov, and uniform benchmarks used in the numerical checks.
- Regularized pilots checked against independent coefficient maps.
- Running-variable units, location shifts, and added affine outcome trends.
- Rademacher, Mammen, and normal multipliers; sample/asymptotic Q; side-specific
  kernels; fixed and bootstrap fuzzy weights; fixed covariate weights.
- Kink-specific fast standard errors and malformed-input errors.
- Raw point estimates match rdrobust in all four kink designs. These checks
  do not expect the two different bias corrections to agree.
- Integration checks use estimated mserd, msetwo, cerrd, and certwo bandwidths,
  with deriv = 1 in both functions, p = 2, q = 3, HC3,
  and the identical h (b = h in rdrobust).

LEVEL-RD REGRESSION CHECKS
-------------------------
regression_test.R compares the new source with the unchanged adjacent 2.0
directory. All 144 retained result objects, including saved bootstrap draws,
match after the requested interface and output-field changes. The
regression script is a local development check and is not needed in the
standalone download.

A further 288 before/after comparisons against the October 29 pre-change snapshot confirm
identical retained results, including bootstrap draws, across level/kink RD,
the four designs, two residual choices, both Q choices, three kernels, and
90%, 95%, and 99% confidence levels.
These comparisons explicitly request boot.keep = TRUE and retain fixed weights.
The snapshot is in ../release-audit-20261029-interface/baseline. Set
IRBC_TEST_BASELINE to that directory when running regression_test.R.

BOOTSTRAP WEIGHT CHECKS
----------------------
bootstrap_weights_test.R reconstructs bootstrap samples from independent local
weighted-least-squares fits, then refits full joint covariate regressions rather
than using the estimator's partialled-out coefficient formula. It checks all
fixed/bootstrap weighting combinations in fuzzy, covariate-adjusted sharp, and
covariate-adjusted fuzzy designs, for both levels and kinks.

- CCT-HC3 and iRBC-HC3 residuals, sample and asymptotic Q, equal and unequal
  bandwidths, and Rademacher, Mammen, and normal multipliers.
- Component statistics, refitted covariate coefficients, fuzzy and combined
  weights, adjusted first stages, final statistics, and interval inversion.
- Original analytic results are unchanged across bootstrap weighting choices.
- Default draw omission preserves the same intervals as boot.keep = TRUE.
- Singular bootstrap covariate regressions omit only the affected draw;
  interval quantiles use the remaining finite draws.

OUTPUT CHECKS
-------------
output_test.R checks 64 public output configurations across all eight designs,
with and without bootstrap inference. Removed fields are absent from root,
nested, and serialized fit objects. h reports requested bandwidths,
while h.minus and h.plus retain effective cutoff bandwidths as output fields.
The checks include scalar, paired, and regularized bandwidths, direct calls
to the three design-specific public functions, and preservation of covariate
names even when they coincide with a removed diagnostic field name.

The interface checks verify the exact argument order and defaults, rejection
of removed arguments (including alpha and kink), and numeric deriv validation
restricted to 0 and 1. NULL and 0 select identical level fits in all four
designs. Named and unnamed bandwidth/kernel
pairs and the full positional argument list agree, including bootstrap draws,
across level and kink designs. Public result fields use kernel, deriv, and level.
The percentage-valued level defaults to 95; malformed and out-of-range values
are rejected. All eight designs have nested 90%, 95%, and 99% analytic and
bootstrap intervals, with estimates, variances, and draws unchanged across
confidence levels. Direct design functions agree with the unified entry point
at all three levels and reject the former alpha argument.
Default draw omission and malformed bootstrap weighting/retention options are
checked across all eight designs.

REPRODUCING CHECKS
-----------------
From the release directory:
  Rscript --vanilla smoke_test.R
  Rscript --vanilla kink_test.R
  Rscript --vanilla output_test.R
  Rscript --vanilla bootstrap_weights_test.R
  Rscript --vanilla examples.R

From the development directory, adjacent to 2.0:
  Rscript --vanilla regression_test.R
  Rscript --vanilla prepare_download.R

prepare_download.R verifies ZIP membership, extracted-file hashes, standalone
checks, kink tests, output tests, bootstrap weight tests, and examples in fresh
R sessions. It writes the actual
check output to release/download_checks.txt. Only the two source files are
required for estimation. Stata source and downloads are unchanged.
