A random-utility-consistent machine learning method to estimateagents’ joint activity scheduling behavior from ubiquitous data
Xiyuan Ren, Joseph Y. J. Chow*
C2SMART University Transportation Center, New York University Tandon School of Engineering,
Brooklyn, USA
xr2006@nyu.edu, joseph.chow@nyu.edu* Corresponding author

Extended abstract submitted for presentation at the 11th Triennial Symposium onTransportation Analysis conference (TRISTAN XI)
June 19-25, 2022, Mauritius Island
January 11, 2022
Keywords: Activity-based modeling, Inverse Optimization, utility maximization, big data,
Shanghai

1INTRODUCTIONThe scheduling of daily activities is a complicated process that covers multiple choice dimensions,
including which activities to perform, as well as the timings, locations, durations, and mode-of-travel
between activities. Existing studies postulate that individuals derive a utility from traveling andperforming activities, and they schedule them to maximize the utility (Adler and Ben-Akiva, 1979).
With such assumption, discrete choice models (DCM) are widely used to reveal the co-impact ofvarious factors on individuals’ choice behaviors. Despite their advantages, DCM tend to come shortof activity scheduling applications, especially with large choice set and under big data context.
Firstly, DCM require a likelihood function defined over finite alternatives, which is hard to formulate
given huge choice set comprised of all possible schedule combinations (Pougala, et al., 2021).
Secondly, DCM provide stochastic estimations based on assumed distributions of random utilities
and coefficients (in the case of mixed logit models), which limits their performance on big datasetswith large sample size while few personal information (Krueger, et al. 2021).
These limitations can be overcome under a ubiquitous data setting where attributes from a whole
population can be obtained instead of just from a sample. In such a scenario, transferability of amodel from a sample to a population is no longer necessary and we can eschew random parameters
to infer individual, fixed parameters. We adopt a deterministic approach based on the inverse
problem of random utility maximization as a hybrid machine learning/econometric method. The
approach presents three key advantages compared to conventional DCM: (i) various choicedimensions (activity timings, locations, durations, and mode-of-travel) and corresponding
parameters are modelled jointly; (ii) the model provides higher prediction accuracy compared toconventional DCM ; (iii) the model produces an empirical distribution of individual preference thatcan be integrated into optimization models more efficiently than relying only on simulation (e.g.
Paneque et al., 2021).

2METHODOLOGY

Our study focuses on the activity scheduling choices of commuters, which includes choices related
to work activity, lunch activity, afterwork activity, and trips between them. There are five choicedimensions in total and 1,470 possible schedules for each individual (Table 1).

TRISTAN XI Symposium

Original abstract submittal

X. Ren, J.Y.J. Chow

2

Table 1 – Five choice dimensions and alternatives in choice sets
Time to leavehome
6:30-7:00
7:00-7:30
7:30-8:00
8:00-8:30
8:30-9:00
9:00-9:30
9:30-10:00

CommutemodeTransit
DrivingTime to havelunch
11:00-11:30
11:30-12:00
12:00-12:30
12:30-13:00
13:00-13:30

Lunch
location
Inside the CBD
Outside the CBD
In workplace

Time to leave
workplace
17:30-18:00
18:00-18:30
18:30-19:00
19:00-19:30
19:30-20:00
20:00-20:30
20:30-21:00

In line with the study of Ettema et al. (2007), we divide a whole-day activity schedule into a sequenceof activities and trips with representative utility functions shown in Eq. (1) – (6), which differs fromconventional DCM in that each parameter is indexed by individual, e.g. 𝑖 .
𝑇𝐴
𝑇𝐴𝐴
𝑉𝑖 = 𝑉𝑐𝑜𝑚𝑚𝑢𝑡𝑒,𝑖+ 𝑉𝑤𝑜𝑟𝑘,𝑖+ 𝑉𝑤𝑜𝑟𝑘−𝑙𝑢𝑛𝑐ℎ,𝑖+ 𝑉𝑙𝑢𝑛𝑐ℎ,𝑖+ 𝑉𝑎𝑓𝑡𝑒𝑟𝑤𝑜𝑟𝑘,𝑖(1)𝑇𝑉𝑐𝑜𝑚𝑚𝑢𝑡𝑒,𝑖 = 𝑡,𝑖 𝑡𝑐𝑜𝑚𝑚𝑢𝑡𝑒 + 𝑐,𝑖 𝑐𝑐𝑜𝑚𝑚𝑢𝑡𝑒 + 𝑚𝑜𝑑𝑒,𝑖 𝑀𝑐𝑜𝑚𝑚𝑢𝑡𝑒(2)
𝐴𝑉𝑤𝑜𝑟𝑘,𝑖= 𝑒𝑤𝑜𝑟𝑘,𝑖 𝑆𝐷𝐸𝑤𝑜𝑟𝑘 + 𝑙𝑤𝑜𝑟𝑘,𝑖 𝑆𝐷𝐿𝑤𝑜𝑟𝑘 + 𝑝𝑙,𝑖 𝑃𝐿𝑤𝑜𝑟𝑘 + 𝑑𝑤𝑜𝑟𝑘,𝑖 𝑙𝑛(𝑑𝑤𝑜𝑟𝑘 )𝑇𝑉𝑤𝑜𝑟𝑘−𝑙𝑢𝑛𝑐ℎ,𝑖= 𝑡𝑙,𝑖 𝑡𝑤𝑜𝑟𝑘−𝑙𝑢𝑛𝑐ℎ𝑒𝑙
𝐴𝑉𝑙𝑢𝑛𝑐ℎ,𝑖 = 𝑙𝑢𝑛𝑐ℎ,𝑖 𝑆𝐷𝐸𝑙𝑢𝑛𝑐ℎ + 𝑙𝑢𝑛𝑐ℎ,𝑖 𝑆𝐷𝐿𝑙𝑢𝑛𝑐ℎ + 𝑘1,𝑖 𝐾1𝑙𝑢𝑛𝑐ℎ + 𝑘2,𝑖 𝐾2𝑙𝑢𝑛𝑐ℎ𝐴𝑉𝑎𝑓𝑡𝑒𝑟𝑤𝑜𝑟𝑘,𝑖= 𝑑𝑎𝑓𝑡𝑒𝑟𝑤𝑜𝑟𝑘,𝑖 ln(𝑑𝑎𝑓𝑡𝑒𝑟𝑤𝑜𝑟𝑘 ) + 𝑖𝑛𝑡𝑒𝑟,𝑖 ln(𝑑𝑤𝑜𝑟𝑘 ) ln(𝑑𝑎𝑓𝑡𝑒𝑟𝑤𝑜𝑟𝑘 )

(3)
(4)
(5)
(6)

𝑇
where 𝑉𝑖 is utility of individual I derived from the whole-day activity schedule; 𝑉𝑐𝑜𝑚𝑚𝑢𝑡𝑒,𝑖iscommute utility, depending on travel time 𝑡𝑐𝑜𝑚𝑚𝑢𝑡𝑒 , travel cost 𝑐𝑐𝑜𝑚𝑚𝑢𝑡𝑒 , and travel mode
𝐴𝑀𝑐𝑜𝑚𝑚𝑢𝑡𝑒 (0 for driving; 1 for public transit); 𝑉𝑤𝑜𝑟𝑘,𝑖is work activity utility, depending on scheduledeviation (schedule early 𝑆𝐷𝐸𝑤𝑜𝑟𝑘 and schedule delay 𝑆𝐷𝐸𝑤𝑜𝑟𝑘 ), additional punishment for late for𝑇work 𝑃𝐿𝑤𝑜𝑟𝑘 , and log-formed work duration 𝑙𝑛(𝑑𝑤𝑜𝑟𝑘 ); 𝑉𝑤𝑜𝑟𝑘−𝑙𝑢𝑛𝑐ℎ,𝑖
is the utility of traveling𝐴
between workplace and lunch spot, here we only consider the travel time 𝑡𝑤𝑜𝑟𝑘−𝑙𝑢𝑛𝑐ℎ ; 𝑉𝑙𝑢𝑛𝑐ℎ,𝑖islunch activity utility, depending on schedule deviation (schedule early 𝑆𝐷𝐸𝑙𝑢𝑛𝑐ℎ and schedule delay
𝑆𝐷𝐸𝑙𝑢𝑛𝑐ℎ ), and lunch spot (𝐾1𝑙𝑢𝑛𝑐ℎ =1 denotes inside the CBD, 𝐾2𝑙𝑢𝑛𝑐ℎ =1 denotes outside the CBD,𝐴
having lunch in workplace is the reference group); 𝑉𝑎𝑓𝑡𝑒𝑟𝑤𝑜𝑟𝑘,𝑖is afterwork activity utility, here we
only consider its total duration in log form, ln(𝑑𝑎𝑓𝑡𝑒𝑟𝑤𝑜𝑟𝑘 ), and an interaction item with workduration, ln(𝑑𝑤𝑜𝑟𝑘 ) ln(𝑑𝑎𝑓𝑡𝑒𝑟𝑤𝑜𝑟𝑘 ). All these variables can be observed from the data, and 𝑡,𝑖 ,

𝑐,𝑖 , 𝑚𝑜𝑑𝑒,𝑖 , 𝑒𝑤𝑜𝑟𝑘.𝑖 , 𝑙𝑤𝑜𝑟𝑘,𝑖 , 𝑝𝑙,𝑖 , 𝑑𝑤𝑜𝑟𝑘,𝑖 , 𝑡𝑙,𝑖 , 𝑒𝑙𝑢𝑛𝑐ℎ,𝑖 , 𝑙𝑙𝑢𝑛𝑐ℎ,𝑖 , 𝑘1,𝑖 , 𝑘2,𝑖 , 𝑑𝑎𝑓𝑡𝑒𝑟𝑤𝑜𝑟𝑘,𝑖, 𝑖𝑛𝑡𝑒𝑟,𝑖 are 14 parameters to be calibrated, as a mixed logit model with deterministic individualtastes. Let us call this an Agent-based Mixed Logit (AMXL) model.
Inverse optimization (IO) is initially used as a machine learning technique to update parametersfrom prior value in traffic assignment or schedule optimization problems (Chow and Recker, 2012;
Xu, et al., 2018). We develop an original approach based on the concept to estimate the individual
parameters of the AMXL model. For each schedule alternative j considered by individual I, we add
a random utility 𝑖𝑗 ~G(0,1). Moreover, we add a safe boundary 𝑏 (𝑏 ≥ 0) to in case 𝑖𝑗 ∗ is muchlarger than 𝑖𝑗 (making most of the constraints useless). A proposed range of 𝑏 is [1,3], which is
between the 75% quantile and 95% quantile of (𝑖𝑗 ∗ − 𝑖𝑗 ). The IO problem is defined as follows:
for a given prior 0 of a schedule utility’s parameter and observed choice 𝑗 ∗ , determine an updated
 such that 𝑗 ∗ has the largest utility in the choice set 𝐽 with a safe boundary 𝑏, while minimizing its
squared 𝐿2 norm from the prior, as shown in Equation (7).
min ‖0 − ‖22 : 𝑉𝑖𝑗∗ + 𝑖𝑗 ∗ ≥ 𝑉𝑖𝑗 + 𝑖𝑗 + 𝑏 , ∀𝑗𝑗 ∗ in 𝐽(7)An additional issue is that we have 1,470 whole-day schedules in the choice set, which isinfeasible for DCM to converge and quite time-consuming for IO. Hence, we decompose the wholeTRISTAN XI Symposium

Original abstract submittal

X. Ren, J.Y.J. Chow

3day schedule choice into three inter-related IO problems: commute choice (time to leave home &commute mode), lunch choice (time to have lunch & lunch location), and afterwork choice (time toleave workplace). By doing this, we reduce the choice set from 1,470 ( 7 × 2 × 5 × 3 × 7 )alternatives, to 14 (7 × 2), 15 (5 × 3), and 7 alternatives respectively, with an additional constraint
ensuring that the shared parameter 𝑑𝑤𝑜𝑟𝑘,𝑖 should be the same (and hence, jointly estimated).
Finally, Method of Self-regulated Average (Liu, et al., 2007) is used to smooth the iterative
convergence to provide stability without solutions flip-flopping. The IO approach is summarized in
Algorithm 1.
Algorithm 1. Inverse optimization with random utility for whole-day activity choice
1. Initialize with 10 =[0,0,0,0,0,0,0,0,0,0,0,0,0,0], n=1,b=1, and the stop criteria  > 0
2. For each individual i,a. Get the priori parameter 𝑛0_𝑐 , 𝑛0_𝑙 , 𝑛0_𝑎 from 𝑛02

b. Solve IO problems: 𝑚𝑖𝑛 ‖𝑛0_𝑐 − 𝑛0_𝑐,𝑖 ‖2 s.t. 𝑉𝑖𝑗∗ + 𝑛𝑖𝑗 ∗ ≥ 𝑉𝑖𝑗 + 𝑛𝑖𝑗 + 𝑏 , ∀𝑗𝑗 ∗ in 𝐽𝑐2𝑚𝑖𝑛 ‖𝑛0_𝑙 − 𝑛0_𝑙,𝑖 ‖2 s.t. 𝑉𝑖𝑗 ∗ + 𝑛𝑖𝑗∗ ≥ 𝑉𝑖𝑗 + 𝑛𝑖𝑗 + 𝑏 , ∀𝑗𝑗 ∗ in 𝐽𝑙2𝑚𝑖𝑛 ‖𝑛0_𝑎 − 𝑛0_𝑎,𝑖 ‖2 s.t. 𝑉𝑖𝑗∗ + 𝑛𝑖𝑗∗ ≥ 𝑉𝑖𝑗 + 𝑛𝑖𝑗 + 𝑏 , ∀𝑗𝑗 ∗ in 𝐽𝑎
c. Calculate the mean value of shared parameter 𝑑𝑤𝑜𝑟𝑘 retrieved from three IO solutions
d. Fixed 𝑑𝑤𝑜𝑟𝑘 and redo step 2be. Combine 𝑛0_𝑐,𝑖 , 𝑛0_𝑙,𝑖 , 𝑛0_𝑎,𝑖 and output 𝑛0,𝑖3. Self-regulated Average: set =1.8, =0.3, calculate 𝑛+1based on 𝑛0 and 𝑚𝑒𝑎𝑛(𝑛0,𝑖 )04. If ‖𝑛+1− 𝑛0 ‖2 ≤ , stop and output 𝑛0,𝑖 , else let n = n+1 and go to step 203

3.1

SELECT RESULTS

Distribution of parameters

The dataset used in our study contains two-weekday activity information of 26,149 commuters
working in the CBD of Shanghai (which we assume to be our population), which was collected using
Shanghai mobile phone data in 2019 (considering data privacy, home location was aggregated into
500m*500m grids, workplace was aggregated into blocks). The IO algorithm took 28.9 hours toconverge at the 60th iteration, resulting in calibrated parameters per individual that are not only
similar with DCM results in signs, but the population distributions of those parameters areempirically derived, revealing them to be neither Gumbel nor Normal (Figure 1). This helps
modelers capture inter-individual heterogeneities when detailed personal information is hard toobtain.

Figure 1 – Distribution of calibrated parameters

3.2

Prediction accuracy

Figure 2 shows a comparison of prediction accuracy by the multinomial logit model (MNL) and theAMXL model. When we predict commuters’ schedule choice on the weekday used to train themodel, the AMXL model improves the individual-level accuracy greatly compared with MNL, fromTRISTAN XI Symposium

Original abstract submittal

X. Ren, J.Y.J. Chow4

1.37% to 47.18%. When we predict on a different weekday using the same population, though theindividual-level accuracy of AMXL model decreases (since almost all commuters made smallchanges on their whole-day schedule), the aggregated-level accuracy is still high with 61.68%
compared with 5.21% in MNL.

Figure 2 – Comparison of prediction accuracy by MNL and AMXL4DISCUSSION

The inverse optimization estimation method combined with the AMXL model is an agent-levelmachine learning method that is theoretically consistent with a utility-maximizing mixed logit modelframework. It provides deterministic estimation at the individual level, which allows modelers to
capture inter-individual heterogeneities given limited personal information and further integrated
them into optimization models. The experimental results based on 26,149 samples show that anAMXL model can improve the individual-level in-sample accuracy, and the aggregated-level outof-sample accuracy. This method is designed for a ubiquitous data set representing a whole
population which is possible with big data. Further scenarios analyzing the trade-offs between
congestion effects, work scheduling policy, and optimal incentives to attract workers to lunch
locations are conducted.

References
Adler, T., & Ben-Akiva, M., 1979. “A Theoretical and Empirical Model of Trip Chaining
Behavior.” Transportation Research Part B: Methodological 13(3): 243–57.
Chow, J.Y.J. & Recker, W.W. 2012. “Inverse Optimization with Endogenous Arrival Time
Constraints to Calibrate the Household Activity Pattern Problem.” Transportation ResearchPart B: Methodological 46(3): 463–79.
Ettema, D., Bastin, F., Polak, J. & Ashiru, O., 2007. “Modelling the Joint Choice of Activity
Timing and Duration.” Transportation Research Part A: Policy and Practice 41(9): 827–41.
Krueger, R., Bierlaire, M., Daziano, R. A., Rashidi, T. H., & Bansal, P., 2021. “Evaluating thePredictive Abilities of Mixed Logit Models with Unobserved Inter-and Intra-IndividualHeterogeneity.” Journal of Choice Modelling 41: 100323.
Liu, H.X., He, X., & He, B. (2009). Method of successive weighted averages (MSWA) and selfregulated averaging schemes for solving stochastic user equilibrium problem. Networks andSpatial Economics, 9(4), 485-503.
Paneque, M. P., Bierlaire, M., Gendron, B., & Azadeh, S.S. (2021). Integrating advanced discrete
choice models in mixed integer linear optimization. Transportation Research Part B:
Methodological, 146, 26-49.
Pougala, J., Hillel, T., & Bierlaire, M., 2021. “Choice Set Generation for Activity-Based Models.”
Swiss Transport Research Conference.
Xu, S.J., Nourinejad, M., Lai, X., & Chow, J.Y.J. (2018). Network learning via multiagent inverse
transportation problems. Transportation Science, 52(6), 1347-1364.
TRISTAN XI Symposium

Original abstract submittal