Random Effects and Hierarchical Models in Driving Behaviors Modeling

4 minute read

Published:

In many driving behavior studies, we model how a following vehicle responds to the movement of a lead vehicle. For example, the Intelligent Driver Model (IDM) uses a set of parameters \(\boldsymbol{\theta} = (v_0, T, a_ {\text{max}}, b, s_0)\) to describe a driver’s response in terms of desired speed, time headway, maximum acceleration, comfortable deceleration, and minimal spacing. A critical challenge, however, is that not all drivers behave the same way. Some maintain larger headways, others brake more aggressively, and still others prefer smoother accelerations.

To accurately capture and interpret this variability, random effects and hierarchical models offer powerful solutions. Instead of forcing all drivers to share the same parameters or estimating each driver’s parameters independently, hierarchical modeling allows us to partially pool information across drivers, improving both the stability and interpretability of our estimates.

Random Effects

Random effects arise when we have multiple groups or clusters—such as individual drivers—in our data. Each driver might have their own IDM parameter vector \(\boldsymbol{\theta}_d\), but we assume these driver-specific parameters come from a common distribution:

\(\boldsymbol{\theta}_d \sim \mathcal{N}(\boldsymbol{\mu}, \boldsymbol{\Sigma}),\) where \(\boldsymbol{\mu}\) is the population-level mean behavior and \(\boldsymbol{\Sigma}\) represents how parameters vary across drivers.

The idea is that each driver’s parameters differ, but are not completely unrelated. By treating parameters as random effects, the model lets drivers with limited data “borrow strength” from the entire population. This partial pooling results in more robust estimates than if each driver’s parameters were estimated in isolation (where they might be highly unstable due to sparse data).

Hierarchical (Multilevel) Models

A hierarchical model (or multilevel model) recognizes that data are often structured in multiple levels. In our case:

  • Level 1 (Observations): At each time step \(t\), driver \(d\) responds to the lead vehicle’s actions. The IDM predicts the acceleration \(a_{d}^{(t)}\):

    \[a_{d}^{(t)} = f_{\text{IDM}}(\boldsymbol{x}_{d}^{(t)}; \boldsymbol{\theta}_d),\]

    where \(\boldsymbol{x}_{d}^{(t)}\) includes inputs like current speed, relative speed, and headway.

  • Level 2 (Drivers): Each driver \(d\) has parameters \(\boldsymbol{\theta}_d\) that govern their behavior. Instead of treating them as fixed, we model them as random effects drawn from a population distribution:

    \[\boldsymbol{\theta}_d|\boldsymbol{\mu},\boldsymbol{\Sigma} \sim \mathcal{N}(\boldsymbol{\mu},\boldsymbol{\Sigma}).\]

This nesting captures the idea that while each driver is unique, all drivers come from a shared population of possible behaviors. The hierarchical framework naturally extends to more levels if needed, such as drivers nested within regions or time-of-day effects nested within drivers.

Benefits in Driving Behavior Analysis

  1. Partial Pooling:
    Drivers with scant data are less likely to yield extreme, unreliable parameter estimates. Instead, their parameters are pulled toward the population mean, resulting in stable and sensible estimates.

  2. Capturing Behavioral Variability:
    We no longer assume a one-size-fits-all IDM. We directly quantify how parameters vary among drivers, providing richer insights into the distribution of driving styles.

  3. Improved Inference and Prediction:
    With a hierarchical model, we can more accurately capture uncertainty and make better predictions. For example, when designing adaptive cruise control algorithms, understanding the full range of human driving behaviors (not just an average scenario) improves system robustness.

Example

  • Non-hierarchical approach (i.e., pooled model):
    Fit one IDM for all drivers, ignoring individual differences. This might produce biased parameter estimates that don’t reflect the true behavioral diversity.

  • Hierarchical approach with random effects:
    Assume each driver has their own IDM parameters, drawn from a common distribution. Fit a hierarchical model that estimates both the population-level parameters (\(\boldsymbol{\mu}, \boldsymbol{\Sigma}\)) and individual driver parameters (\(\boldsymbol{\theta}_d\)).
    If a given driver is observed frequently, their parameters will closely reflect their unique style. If another driver is seen only briefly, their parameters won’t be as precise, but partial pooling ensures reasonable estimates informed by the entire sample of drivers.

Conclusion

random effects and hierarchical models provide a principled way to incorporate individual variability in driving behavior studies. By acknowledging that parameters vary across drivers and linking these parameters through a higher-level distribution, we gain more reliable, interpretable, and realistic representations of car-following dynamics.

  1. Chengyuan Zhang and Lijun Sun* (2023). Bayesian Calibration of the Intelligent Driver Model. IEEE Transactions on Intelligent Transportation Systems. [IEEE TITS] [arXiv] [code] [presentation] [poster]

  2. Chengyuan Zhang, Wenshuo Wang, and Lijun Sun* (2024). Calibrating Car-Following Models via Bayesian Dynamic Regression. Transportation research part C: emerging technologies. (Accepted to ISTTT25 Special Issue) [TR PartC] [arXiv] [code] [presentation] [slides]

Read more