Duration
duration
Duration estimation utilities based on statistical requirements and traffic pipelines.
This module provides tools to estimate the temporal duration of an experiment run, mapping the conceptually abstract "required sample size" derived from statistical power analysis into physical calendar time (days) using observed traffic rates and ramp-up schedules.
| FUNCTION | DESCRIPTION |
|---|---|
estimate_duration_days |
Estimates the required experiment run duration in days. |
estimate_duration_days
Estimates the required experiment run duration in days.
Translates the calculated target sample size (\(N_{\text{required}}\)) into the estimated calendar days needed to accumulate that sample volume based on active daily traffic (\(T_{\text{daily}}\)).
Mathematical Model
The duration in days (\(D\)) is computed as: $$ D = \frac{N_{\text{required}}}{T_{\text{daily}}} $$ where \(N_{\text{required}}\) represents the combined total sample size across all active arms (control + treatment arms) or the single-arm requirement multiplied by the number of arms.
| PARAMETER | DESCRIPTION |
|---|---|
required_sample_size
|
The total sample size needed across all arms combined (e.g., control \(n\) + treatment \(n\)). Must be greater than zero.
TYPE:
|
daily_traffic
|
The expected number of unique qualifying experimental units (e.g., users, sessions, or pageviews) entering the experiment pipeline per day. Must be greater than zero.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
float
|
Estimated run duration in decimal calendar days.
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
TypeError
|
If |
ValueError
|
If |
Examples: