# Bayesian Inference on Dynamic Linear Models of Day-to-Day Origin-Destination Flows in Transportation Networks

^{1}

^{2}

^{3}

^{*}

^{†}

## Abstract

**:**

## 1. Introduction

## 2. Modeling Framework

#### 2.1. A Dynamic Linear Model for Day-to-Day OD Flows

#### 2.1.1. Model Definition

#### 2.1.2. Estimation of Mean OD Flows

- Starting from $t=0$, set $\mathbb{P}\left({\mathit{\theta}}_{0}\right|{\mathit{z}}_{0})=\mathbf{N}({\mathit{m}}_{0},{\mathbf{C}}_{0})$;
- For $t=1$ to T, do:
- (a)
- (b)
- Compute the assignment matrix ${\mathbf{F}}_{t}$ by means of Equation (7).
- (c)
- (d)
- (e)

#### 2.2. Bayesian Inference on Route Choice Parameters

#### 2.2.1. Utility Model and Route Choice Probabilities

#### 2.2.2. An MCMC Algorithm

- (backward sampling) Starting from ${\mathit{\theta}}_{T}\sim \mathbf{N}({\mathit{m}}_{t},{\mathbf{C}}_{t})$, for $t=T-1,\cdots ,1$, sample each ${\mathit{\theta}}_{t}$ backwards from the conditionals $\mathbb{P}\left({\mathit{\theta}}_{t}\right|{\mathit{\theta}}_{t+1},\mathit{\varphi},{\mathit{z}}_{1:T})=\mathbf{N}({\mathit{h}}_{t},{\mathbf{H}}_{t})$, in which:$$\begin{array}{cc}\hfill {\mathbf{h}}_{t}& ={\mathbf{m}}_{t}+{\mathbf{B}}_{t}({\mathit{\theta}}_{t+1}-{\overline{\mathbf{m}}}_{t+1}),\hfill \end{array}$$$$\begin{array}{cc}\hfill {\mathbf{H}}_{t}& ={\mathbf{C}}_{t}-{\mathbf{B}}_{t}{\overline{\mathbf{C}}}_{t}{\mathbf{B}}_{t}^{\phantom{\rule{-0.166667em}{0ex}}\mathsf{T}},\hfill \end{array}$$

- Initialize vectors ${\mathit{\varphi}}^{\left(0\right)}$ and ${\mathit{\theta}}_{1:T}^{\left(0\right)}$.
- From iteration $i=0$ onwards, repeat until convergence:
- (a)
- (b)
- (MH step) Sample a candidate ${\mathit{\varphi}}^{\prime}$ according to a proposal distribution $\mathbb{Q}\left({\mathit{\varphi}}^{\prime}\right|{\mathit{\varphi}}^{\left(i\right)})$ and make ${\mathit{\varphi}}^{(i+1)}={\mathit{\varphi}}^{\prime}$ according to acceptance test given in Equation (24), otherwise make ${\mathit{\varphi}}^{(i+1)}={\mathit{\varphi}}^{\left(i\right)}$.

## 3. Results and Discussion

#### 3.1. Generation of Simulated Data

- At $t=0$, set values for $\mathbf{\Delta}$, ${\mathit{\theta}}_{0}$, ${\mathbf{W}}_{t}$, ${\mathbf{\Sigma}}_{t}^{x}$, ${\mathbf{\Sigma}}_{t}^{z}$, $\mathit{\varphi}$, $\pi $ for $t=1$ to T and past route costs ${\mathit{c}}_{1-r}={\mathit{c}}_{1-r+1}=\cdots ={\mathit{c}}_{0}={\mathit{c}}_{\mathrm{freeflow}}$, where r is the size of users’ memory and ${\mathit{c}}_{\mathrm{freeflow}}$ denotes route costs computed assuming free flow in the network.
- For $t=1$ to T do:
- (a)
- Sample mean OD flows ${\mathit{\theta}}_{t}\sim \mathbf{N}({\mathit{\theta}}_{t-1},{\mathbf{W}}_{t})$.
- (b)
- Sample OD flows ${\mathit{x}}_{t}|{\mathit{\theta}}_{t}\sim \mathbf{N}({\mathit{\theta}}_{t},{\mathbf{\Sigma}}_{t}^{x}).$
- (c)
- (d)
- Sample route flows ${\mathit{y}}_{t}|{\mathit{x}}_{t}\sim \mathbf{N}({\mathbf{P}}_{t}{\mathit{x}}_{t},{\mathbf{\Sigma}}_{t}^{y})$, where ${\mathbf{\Sigma}}_{t}^{y}$ is calculated from Equation (3).
- (e)
- Calculate route costs ${\mathit{c}}_{t}={\mathbf{\Delta}}^{\phantom{\rule{-0.166667em}{0ex}}\mathsf{T}}g(\mathbf{\Delta}{\mathit{y}}_{t})$, where $g(.)$ is a vector function which returns a vector of costs on links based on BPR functions given by Equation (25).
- (f)
- Sample observed traffic volumes ${\mathit{z}}_{t}|{\mathit{y}}_{t}\sim \mathbf{N}(\mathbf{\Delta}{\mathit{y}}_{t},{\mathbf{\Sigma}}_{t}^{z})$.

#### 3.2. Application of the MCMC Algorithm

#### 3.3. Unknown Evolution Matrix

#### 3.4. Observation of Traffic Volumes on Partial Links

## 4. Conclusions

## Author Contributions

## Funding

## Conflicts of Interest

## Nomenclature

${\mathit{\theta}}_{t}$ | Vector of mean OD flows at time t; |

${\mathit{x}}_{t}$ | Vector of realized origin–destination (OD) flows at time t; |

${\mathit{y}}_{t}$ | Vector of route flows at time t; |

${\mathit{z}}_{t}$ | Vector of traffic volumes on links at time t; |

${\mathit{p}}_{t}$ | Vector of route choice probabilities at time t; |

${\mathit{c}}_{t}$ | Vector of route costs at time t; |

${\mathcal{K}}_{i}$ | Set of routes for OD pair i; |

$\mathit{\varphi}$ | Vector of parameters in the utility equation of a route given past route costs; |

$\pi $ | Probability of not using a route in a given route choice set; |

$\tau (.)$ | Performance (cost) function of a link; |

${\mathit{\nu}}_{t}$ | Vector of random errors in the observational model at time t; |

${\mathit{\omega}}_{t}$ | Vector of evolution errors in the as the dynamic model at time t; |

${\mathbf{G}}_{t}$ | State evolution matrix (system matrix); |

${\mathbf{F}}_{t}$ | Assignment matrix at time t; |

${\mathbf{W}}_{t}$ | Evolution covariance matrix of mean OD flows at time t; |

${\mathbf{V}}_{t}$ | Covariance matrix of traffic volumes on links at time t; |

${\mathbf{\Sigma}}_{t}$ | A covariance matrix at time t; |

${\mathbf{P}}_{t}$ | Route choice matrix at time t; |

$\mathbf{\Delta}$ | A link-path incidence matrix; |

${\overline{\mathit{m}}}_{t}$v | Location vector of the prior distribution of mean OD flows at time t; |

${\overline{\mathbf{C}}}_{t}$ | Covariance matrix of the prior distribution of mean OD flows at time t; |

${\mathit{m}}_{t}$ | Location vector of the posterior distribution of mean OD flows at time t; |

${\mathbf{C}}_{t}$ | Covariance matrix of the posterior distribution of mean OD flows at time t; |

$\mathbf{I}$ | The identity matrix; |

$\mathrm{diag}\left(\mathit{x}\right)$ | A matrix whose main diagonal is the vector $\mathit{x}$ and entries off the main diagonal are all zero; |

$\mathrm{blockdiag}\left({\mathbf{X}}_{i}\right)$ | A block-diagonal matrix composed of submatrices ${\mathbf{X}}_{i}$; |

$\mathbf{N}(\mathit{\mu},\mathbf{\Sigma})$ | Multivariate normal distribution with mean vector $\mathit{\mu}$ and covariance matrix $\mathbf{\Sigma}$; |

$\mathrm{MN}(x,\mathit{p})$ | Multinomial distribution with parameters x and $\mathit{p}$. |

## References

- De Dios Ortúzar, J.; Willumsen, L. Modelling Transport, 4th ed.; Wiley: Chichester, UK, 2011. [Google Scholar]
- Cascetta, E. Transportation Systems Analysis: Models and Applications, 2nd ed.; Springer: New York, NY, USA, 2009. [Google Scholar]
- Robillard, P. Estimating the OD matrix from observed link volumes. Transp. Res.
**1975**, 9, 123–128. [Google Scholar] [CrossRef] - Nguyen, S. Estimating an OD Matrix from Network Data: A Network Equilibrium Approach; Technical Report; Centre de Recherche sur les Transports, Université de Montreal: Montreal, QC, Canada, 1977. [Google Scholar]
- Beckmann, M.; McGuire, C.; Winsten, C.B. Studies in Economics of Transportation; Yale University Press: Ann Arbor, MI, USA, 1956. [Google Scholar]
- Van Zuylen, H.J.; Willumsen, L.G. The most likely trip matrix estimated from traffic counts. Transp. Res. Part B
**1980**, 14, 281–293. [Google Scholar] [CrossRef][Green Version] - Cascetta, E. Estimation of Trip Matrices from Traffic Counts and Survey Data: A Generalized Least Squares Estimator. Transp. Res. Part B
**1984**, 16, 289–299. [Google Scholar] [CrossRef] - Cascetta, E.; Nguyen, S. A unified framework for estimating or updating origin/destination matrices from traffic counts. Transp. Res. Part B
**1988**, 22B, 437–455. [Google Scholar] [CrossRef] - Brenninger-Göthe, M.; Jörnsten, K.O. Estimation of origin–destination matrices from traffic counts using multiobjective programming formulations. Transp. Res. Part B
**1989**, 23B, 257–269. [Google Scholar] [CrossRef] - Fisk, C. On combining maximum entropy trip matrix estimation with user optimal assignment. Transp. Res. Part B
**1988**, 22B, 69–79. [Google Scholar] [CrossRef] - Fisk, C. Trip matrix estimation from link counts: the congested network case. Transp. Res. Part B
**1989**, 23B, 331–336. [Google Scholar] [CrossRef] - Wardrop, J.G. Some theoretical aspects of traffic research. In Proceedings of the Institution of Civil Engineers Part II; Institution of Civil Engineers: London, UK, 1952; Volume 1, pp. 325–378. [Google Scholar]
- Smith, M. The existence, uniqueness and stability of traffic equilibria. Transp. Res. Part B
**1979**, 13B, 295–304. [Google Scholar] [CrossRef] - Yang, H.; Sasaki, T.; Iida, Y.; Asakura, Y. Estimation of origin–destination matrices from link counts on congested networks. Transp. Res. Part B
**1992**, 26B, 417–434. [Google Scholar] [CrossRef] - Yang, H. Heuristic algorithms for the bilevel origin–destination matrix estimation problem. Transp. Res. Part B
**1995**, 29B, 231–242. [Google Scholar] [CrossRef] - Cascetta, E.; Postorino, N. Fixed point approaches to the estimation of O/D matrices using traffic counts on congested networks. Transp. Sci.
**2001**, 35, 134–147. [Google Scholar] [CrossRef] - Sheffi, Y. Urban Transportation Networks: Equilibrium Analysis with Mathematical Programming Methods; Prentice-Hall: Englewood Cliffs, NJ, USA, 1985. [Google Scholar]
- Vardi, Y. Network tomography: Estimating source-destination traffic intensities from link data. J. Am. Stat. Assoc.
**1996**, 91, 365–377. [Google Scholar] [CrossRef] - Tebaldi, C.; West, M. Bayesian inference on network traffic using link count data. J. Am. Stat. Assoc.
**1998**, 93, 557–573. [Google Scholar] [CrossRef] - Hazelton, M.L. Estimation of origin–destination matrices from link flows on uncongested networks. Transp. Res. Part B
**2000**, 34, 549–566. [Google Scholar] [CrossRef] - Hazelton, M.L. Some comments on origin–destination matrix estimation. Transp. Res. Part A
**2003**, 37, 811–822. [Google Scholar] [CrossRef] - Hazelton, M.L. Inference for origin–destination matrices: Estimation, prediction and reconstruction. Transp. Res. Part B
**2001**, 35, 667–676. [Google Scholar] [CrossRef] - Cremer, M.; Keller, H. A new class of dynamic methods for the identification of origin–destination flows. Transp. Res. Part B
**1987**, 21, 117–132. [Google Scholar] [CrossRef] - Cascetta, E.; Inaudi, D.; Marquis, G. Dynamic estimators of origin–destination matrices using traffic counts. Transp. Sci.
**1993**, 27, 363–373. [Google Scholar] [CrossRef] - Ashok, K.; Ben-Akiva, M.E. Estimation and prediction of time-dependent origin–destination flows with a stochastic mapping to path flows and link flows. Transp. Sci.
**2002**, 36, 184–198. [Google Scholar] [CrossRef] - Hazelton, M.L. Statistical inference for time varying origin–destination matrices. Transp. Res. Part B
**2008**, 42, 542–552. [Google Scholar] [CrossRef] - Parry, K.; Hazelton, M. Bayesian inference for day-to-day dynamic traffic models. Transp. Res. Part B
**2013**, 50, 104–115. [Google Scholar] [CrossRef] - Hazelton, M.L.; Parry, K. Statistical methods for comparison of day-to-day traffic models. Special issue: Day-to-Day Dynamics in Transportation Networks. Transp. Res. Part B: Methodol.
**2016**, 92, 22–34. [Google Scholar] [CrossRef] - Watling, D.P.; Cantarella, G.E. Modelling sources of variation in transportation systems: Theoretical foundations of day-to-day dynamic models. Transp. B Transp. Dyn.
**2013**, 1, 3–32. [Google Scholar] [CrossRef] - Cantarella, G.E.; Watling, D.P. Modelling road traffic assignment as a day-to-day dynamic, deterministic process: A unified approach to discrete- and continuous-time models. EURO J. Transp. Logist.
**2015**, 5, 69–98. [Google Scholar] [CrossRef] - West, M.; Harrison, J. Bayesian Forecasting and Dynamic Models, 2nd ed.; Springer: New York, NY, USA, 1997. [Google Scholar]
- Särkkä, S. Bayesian Filtering and Smoothing; Cambridge University Press: New York, NY, USA, 2013. [Google Scholar]
- Ben-Akiva, M.; Lerman, S.R. Discrete Choice Analysis: Theory and Application to Travel Demand; MIT Press: Cambridge, MA, USA, 1985. [Google Scholar]
- Geman, S.; Geman, D. Stochastic Relaxation, Gibbs Distributions, and the Bayesian Restoration of Images. IEEE Trans. Pattern Anal. Mach. Intell.
**1984**, PAMI-6, 721–741. [Google Scholar] [CrossRef] - Carter, C.K.; Kohn, R. On Gibbs Sampling for State Space Models. Biometrika
**1994**, 81, 541–553. [Google Scholar] [CrossRef] - Frühwirth-Schnatter, S. Data augmentation and dynamic linear models. J. Time Ser. Anal.
**1994**, 15, 183–202. [Google Scholar] [CrossRef] - Hastings, W.K. Monte Carlo sampling methods using Markov chains and their applications. Biometrika
**1970**, 57, 97–109. [Google Scholar] [CrossRef] - Bureau of Public Roads. Traffic Assignment Manual for Application with a Large, High Speed Computer; U.S. Departmnet of Commerce, Bureau of Public Roads, Office of Planning, Urban Planning Division: Washington, DC, USA, 1964. [Google Scholar]

**Figure 1.**Hierarchical relationship between variables in the DLM. Mean OD flows, realized OD flows and route flows are unobserved variables.

**Figure 2.**Network used in the numerical studies (adapted from [28]).

**Figure 4.**Kernel density estimation for the marginal posteriors of ${\varphi}_{1}$ and ${\varphi}_{2}$. Vertical axes show probability density. Vertical bars show true simulated values.

**Figure 5.**Simulated and estimated mean OD flows. Horizontal axes show time periods, while vertical axes show magnitude of OD flows.

**Figure 6.**Simulated and estimated mean OD flows for $\delta =0.9$. Horizontal axes show time periods, while vertical axes show magnitude of OD flows.

**Figure 7.**Simulated and estimated mean OD flows with observed traffic volumes on links 1, 7 and 9. Horizontal axes show time periods, while vertical axes show magnitude of OD flows.

**Figure 8.**Simulated and estimated mean OD flows with observed traffic volumes on link 1. Horizontal axes show time periods, while vertical axes show magnitude of OD flows.

Link | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
---|---|---|---|---|---|---|---|---|---|---|

CL | 0.5500 | 0.8940 | 0.2482 | 0.2535 | 0.6378 | 0.6473 | 0.2481 | 0.2542 | 0.8914 | 0.5685 |

**Table 2.**Estimation results given different discount factors (HPD—95% highest posterior density region).

$\mathit{\delta}$ | ${\widehat{\mathit{\varphi}}}_{1}$ | HPD | ${\widehat{\mathit{\varphi}}}_{2}$ | HPD | MSE (OD Flows) |
---|---|---|---|---|---|

0.7 | 0.4941 | [0.3265, 0.6659] | 0.3340 | [0.1475, 0.5007] | 137.27 |

0.8 | 0.4960 | [0.3178, 0.6600] | 0.3380 | [0.1674, 0.5288] | 82.84 |

0.9 | 0.4898 | [0.3121, 0.6606] | 0.3313 | [0.1480, 0.5057] | 33.07 |

**Table 3.**Estimation results with observation on partial links (HPD—95% highest posterior density region).

Observed Links | ${\widehat{\mathit{\varphi}}}_{1}$ | HPD | ${\widehat{\mathit{\varphi}}}_{2}$ | HPD | MSE (OD Flows) |
---|---|---|---|---|---|

1 | 0.6088 | [0.0065, 1.1342] | 0.3904 | [0.0014, 0.8312] | 471.67 |

2 | 0.6283 | [0.3897, 0.8247] | 0.4707 | [0.2509, 0.6827] | 256.53 |

9 | 0.5877 | [0.3697, 0.7972] | 0.3644 | [0.1608, 0.5752] | 233.34 |

2 and 5 | 0.5115 | [0.3194, 0.6817] | 0.3681 | [0.1692, 0.5422] | 246.70 |

1 and 9 | 0.5728 | [0.3608, 0.7456] | 0.3640 | [0.1760, 0.5546] | 175.43 |

2, 5 and 9 | 0.5023 | [0.3241, 0.6838] | 0.3323 | [0.1383, 0.5039] | 86.51 |

1, 7 and 9 | 0.5933 | [0.3947, 0.7936] | 0.3676 | [0.1870, 0.5870] | 59.82 |

© 2018 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Pitombeira-Neto, A.R.; Loureiro, C.F.G.; Carvalho, L.E. Bayesian Inference on Dynamic Linear Models of Day-to-Day Origin-Destination Flows in Transportation Networks. *Urban Sci.* **2018**, *2*, 117.
https://doi.org/10.3390/urbansci2040117

**AMA Style**

Pitombeira-Neto AR, Loureiro CFG, Carvalho LE. Bayesian Inference on Dynamic Linear Models of Day-to-Day Origin-Destination Flows in Transportation Networks. *Urban Science*. 2018; 2(4):117.
https://doi.org/10.3390/urbansci2040117

**Chicago/Turabian Style**

Pitombeira-Neto, Anselmo Ramalho, Carlos Felipe Grangeiro Loureiro, and Luis Eduardo Carvalho. 2018. "Bayesian Inference on Dynamic Linear Models of Day-to-Day Origin-Destination Flows in Transportation Networks" *Urban Science* 2, no. 4: 117.
https://doi.org/10.3390/urbansci2040117