Closed Hussein-Mahfouz closed 2 months ago
notes from meeting with @stuartlynn re handling people travelling together:
home
-> work
. I need to check the NTS data to see the distribution of TRipPurposeFrom
when TripPurposeTo
is workschool
-> work
trip for adults dropping off their kids and then going to work. TotalTripTime
from school locationFrom discussion of options on matching people to workplaces (and other locations):
How to constrain the flows to the census commuting data. From A dynamic microsimulation model for epidemics (dyme paper) section 2.4.2:
we initially adopt a stylized approach constructing ‘virtual workplaces’ which rely on the 2011 UK Census commuting origin-destination tables at the MSOA level for individuals with a fixed workplace. The UKTUS data includes a Standard Industry Classification (SIC) code for everyone in the dataset.Matching data from the UKTUS to SPENSER baseline data via the PSM process and the UKTUS we were able to assign to each of our synthetic resident workers an employer industry among the 21 divisions from the Standard Industry Classification (SIC) 2007. We assume that all workers have an equal ex ante probability to commute to all destinations independently from the SIC to which they belong. We build the set of possible destinations by multiplying the number of MSOAs in the study area, M = 107, to that of the SIC divisions, S = 21, obtaining 2,247 options. We then populate these virtual workplaces with synthetic workers based on their reference SIC and their Census relative probability to commute from Mi to any Mj, with j = 1...i...J, thus including the MSOA in which the worker resides.
@BZ-BowenZhang: as discussed Friday, just adding some further detail on ideas for two options for the workplace locations, feel free to let me know if helpful to discuss further at all.
Aim: to assign a workplace location to a given person's schedule after matching NTS to SPC and measure the consistency/validity with observed data sources and modelling.
Reader
class that is available in acbm
from the SPC toolkit (uatk-spc
):
from uatk_spc.reader import Reader
spc = Reader(path, region, backend="pandas", input_type="parquet")
# Has workplace assigned
spc.people
# Has location for a given workplace
spc.venues_per_activity
How do you add work locations for the SPC after each individual has been mapped to an individual in the NTS? We start with the input data (let's call it spc_activity_chains). Each individual now has:
sic1d2007
: Standard Industry Classification of economic activities 2007, 1st level (derived from UK TUS 2015) - (from theSPC
)TripPurpose
|TripPurposeFrom
|TripEnd
|TripTotalTime
|Mode
- (from theNTS
)A potential workflow could include:
1. From spc_activity_chains, filter all individuals with TripPurpose = work
2. Identify spatial distribution of different jobs
3. Determine feasible locations (zones) of workplace
For each person in spc_activity_chains, identify zones that are reachable within a buffer time of TripTotalTime (e.g. TripTotalTime +- 15 minutes)
4. Choose a zone from feasible zones
5. Choose a specific workplace
Notes
Step 4 / 5
Other