Build an OD-pair validation table for MPD, adjusted, and benchmark flows
Source:R/validate_flows.R
validate_flow_pairs.RdJoins adjusted-flow output to benchmark OD flows and returns a tidy table with
original MPD flow, adjusted flow, benchmark flow, legacy first-minus-second
difference columns, and canonical signed residual columns. This complements
validate_flow_overall(), which summarizes method-level fit, by
exposing OD-level differences directly.
For richer residual diagnostics (absolute residuals, percentage residuals,
improvement flags, and a top-worst table), use
validate_flow_residuals().
Retained for backwards compatibility. New code should prefer
validate_flow_pairs().
Usage
validate_flow_pairs(
adj_df,
benchmark_od_df,
flow_col_mpd = "flow",
flow_col_adj = "flow_adj",
flow_col_bench = "flow"
)
validate_flow_all(...)Arguments
- adj_df
Data frame with at least
origin,destination, an MPD flow column (default"flow"), and an adjusted flow column (default"flow_adj"). If present,mpd_sourceis carried through.- benchmark_od_df
Data frame with at least
origin,destination, and a benchmark flow column (default"flow").- flow_col_mpd
Name of MPD flow column in
adj_df. Default"flow".- flow_col_adj
Name of adjusted flow column in
adj_df. Default"flow_adj".- flow_col_bench
Name of benchmark flow column in
benchmark_od_df. Default"flow".- ...
Arguments passed to
validate_flow_pairs().
Value
A tibble with columns:
origin, destination(andmpd_sourceif present),mpd_flow,benchmark_flow,adj_flow,diff_mpd_benchmark = mpd_flow - benchmark_flow,diff_mpd_adj = mpd_flow - adj_flow,diff_adj_benchmark = adj_flow - benchmark_flow,signed_residual_adjusted_vs_benchmark = benchmark_flow - adj_flow,signed_residual_raw_vs_benchmark = benchmark_flow - mpd_flow,signed_residual_raw_vs_adjusted = adj_flow - mpd_flow.