A/A Test
aa_test
A/A test simulations and false-positive rate validation.
This module provides validation systems for checking the empirical Type I error rate (\(\alpha\)) of the experimental pipeline by performing statistical A/A test evaluations on historical or control data.
| FUNCTION | DESCRIPTION |
|---|---|
run_aa_test_validation |
Runs an A/A test validation check, asserting that identical splits exhibit no treatment effect. |
run_aa_test_validation
run_aa_test_validation(
df: DataFrame,
treatment_col: str,
metric_col: str,
num_simulations: int = 100,
seed: int = 42,
) -> dict
Runs an A/A test validation check, asserting that identical splits exhibit no treatment effect.
An A/A test compares two groups that receive the exact same experience. The objective is to validate the statistical pipeline and confirm that the empirical false positive rate matches theoretical expectations.
| PARAMETER | DESCRIPTION |
|---|---|
df
|
The historical control dataset.
TYPE:
|
treatment_col
|
Column name representing the mock or actual assignments.
TYPE:
|
metric_col
|
Column name containing the numeric values under test.
TYPE:
|
num_simulations
|
Number of permutation splits to simulate. Defaults to 100.
TYPE:
|
seed
|
Seed for random generator to guarantee reproducibility. Defaults to 42.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
dict
|
A dictionary containing: - ks_pvalue: The Kolmogorov-Smirnov test p-value indicating goodness-of-fit to a Uniform(0, 1) distribution. - empirical_alpha_05: The raw empirical rejection rate at alpha=0.05. - fdr_alpha_05: The rejection rate after applying Benjamini-Hochberg False Discovery Rate control.
TYPE:
|