Skip to content

Traffic counts cleanup #15

Description

@yueshuaing

This issue is open to discuss/explain the issue noticed in BayAreaMetro/tm2py#174 comments:

item2: acceptance-roadway.twb/7 - Pct RMSE Daily Chart and 8 - Pct RMSE Time-of-day Chart: Why do we make the line for the three key time of day periods, but we are consistently over it for the daily chart? Please check that the calculations are correct (perhaps try on a subset of the links).

Issues identified in the current scripts in preparing PeMS traffic counts:

1. Some stations don't have counts data for five time periods.

number of time periods number of stations
5 2919
4 42
3 31
2 6
1 8

All-day counts calculation should exclude the 87 stations that don’t have all five periods.

all_day_df = (
median_across_years_df.groupby(["station_id", "type", "vehicle_class"])[
"observed_flow"
]
.sum()
.reset_index()
)
all_day_df["time_period"] = self.canonical.ALL_DAY_WORD

2. Take median across multiple stations on same link can mislead
Counts from different stations snapped to the same link can vary largely. For example, stations 412787_N and 412788_N map to the same link, but 412788_N records 4× the volume of 412787_N. So taking the median may introduce errors in validation results. Visual review of these station locations may be needed.
Image

# take median across multiple stations on same link
median_df = (
out_df.groupby(
[
"A",
"B",
"emme_a_node_id",
"emme_b_node_id",
"time_period",
"vehicle_class",
]
)["observed_flow"]
.agg("median")
.reset_index()
)

3. ODOT percent-RMSE thresholds: daily vs. hourly
The current summary appears to apply daily ODOT acceptable percent RMSE thresholds to hourly volumes for the same link. For example, for the hourly volume range 1750.0–2062.5, should the acceptable threshold be 62 rather than 28?
Image
Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions