speed_validation¶
Speed-based validation of temporal dominance across multiple congestion metrics.
speed_validation
¶
Speed-based validation of temporal dominance.
Runs one-way ANOVA across multiple speed metrics (jam factor, current speed, speed reduction, free-flow speed) and computes centrality correlations per metric type to confirm that temporal dominance is not an artifact of jam factor normalization.
load_metric_arrays
¶
Load per-city, per-period arrays for each speed metric.
Returns nested dict: {city_code: {metric: {period: array}}}.
Source code in src/trafficpipeline/speed_validation.py
compute_eta_squared
¶
One-way ANOVA returning F, p, and eta-squared.
Source code in src/trafficpipeline/speed_validation.py
anova_all_metrics
¶
Run ANOVA for each city × metric combination.
Returns a DataFrame with columns: city, metric, f_statistic, p_value, eta_squared, eta_squared_pct.
Source code in src/trafficpipeline/speed_validation.py
centrality_correlations
¶
Compute Pearson R² between betweenness centrality and each metric.
Requires the bottleneck module's spatial join to have been run, or loads evening-peak GeoPackages and matches centrality via OSMnx.
Returns DataFrame with columns: city, metric, r_squared, pearson_r, p_value.
Source code in src/trafficpipeline/speed_validation.py
plot_eta_squared_comparison
¶
Grouped bar chart of η² across metrics and cities.
Source code in src/trafficpipeline/speed_validation.py
plot_centrality_r2
¶
Grouped bar chart of centrality R² per metric and city.
Source code in src/trafficpipeline/speed_validation.py
run_analysis
¶
Run speed-based validation analysis.