Skip to content

feat: supporting week surveys (like emg 2023) - #481

Open
sebhoerl wants to merge 9 commits into
mainfrom
feat/emg23-weekly
Open

feat: supporting week surveys (like emg 2023)#481
sebhoerl wants to merge 9 commits into
mainfrom
feat/emg23-weekly

Conversation

@sebhoerl

@sebhoerl sebhoerl commented Mar 26, 2026

Copy link
Copy Markdown
Contributor

This PR adds support for week-based surveys from MobiSurvStd. While this is currently only the EMG 2023 for Île-de-France, the implementation is generic and intended to be future-proof.

Generating week-long activity sequences

By default, a week-long survey will create week-long activity chains. The survey data is structured such that time=0 corresponds to midnight on Monday, Tuesday starts at 24 * 3600, etc.

Generating daily activity sequences

There are two ways of making use of a week survey to generate daily activity sequences:

  • Sampling: For each survey person, we sample a weekday. The sampling is replicable given a random_seed. This approach reduces the amount of available observations, but is straight-forward.
  • Splitting: We split up persons and households such as to have one instance of them for each weekday. The weights are adapted accordingly. But notice that this generates that this increases the absolute number of households and persons in the generated data frames.

Configuration

The pipeline will detect automatically if a week survey has been selected. In that case, the mobisurvstd.weekly attribute is examined:

mobisurvstd:
  weekly: keep # sample, split

Additional modifications

In order to support EMG2023, one can now choose which distances to use (so far MobiSurvStd only provided euclidean_distance, but the EMG only has routed_distance:

mobisurvstd:
  distance: auto # euclidean, routed

While one can choose manually (for surveys that may provide both information), the auto option will check what information is available and prefer routed over euclidean if both are present.

Caveats

When using split or sample, the basis is still the whole EMG2023 survey, which means any day of the week from Monday to Sunday. You should make use of #474 to restrict the considered days from Monday to Friday if necessary.

TODO:

  • Handle MATSim part cleanly (extending the schedule)
  • Provide some plausibility tests here

@sebhoerl sebhoerl changed the title feat: week-long activity chains from emg2023 feat: supporting week surveys (like emg 2023) Jun 3, 2026
@sebhoerl

sebhoerl commented Jun 3, 2026

Copy link
Copy Markdown
Contributor Author

Using EMG2023 with the three different methods: We show the number of persons actively participating in an activity at every timestamp, using activities.csv. Note that in this example, the sampling / splitting method considers all days (including weekend).

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant