# Exploring the Direct and Indirect Use of ICT Measurements in DODME (Dynamic OD Matrix Estimation) +
## 2 Direct Problem Formulation  
The most used approaches formulate DODME as a bi-level optimization problem in terms of the minimization at the upper level of certain distance functions \(F_{1}\big{(}\mathbf{X},\mathbf{X}^{\mathbf{H}}\big{)}\) between the estimated origin-to-destination (OD) matrix \(\mathbf{X}\) and an acceptable historical OD matrix \(\mathbf{X}^{\mathbf{H}}\) representing a priori valid knowledge, at least in terms of the structure of the mobility patterns that are represented by the OD, and \(F_{2}\big{(}\mathbf{Y},\hat{\mathbf{Y}}\big{)}\) between the measured link flows \(\hat{\mathbf{Y}}\) at a subset of links in the network equipped with detectors and the corresponding estimated flows \(\mathbf{Y}\). Furthermore, a traffic assignment at the lower level provides the estimates of the current flows \(\mathbf{Y}\) from the current estimated OD matrix \(\mathbf{X}\). Therefore, an apparently straightforward extension of this bi-level formulation that accounts for the measured \(\hat{\mathbf{H}}\) and estimated travel times \(\mathbf{t}\mathbf{t}\) would be to expand the objective function by adding a third term \(F_{3}(\mathbf{t}\mathbf{t},\hat{\mathbf{t}})\) that minimizes some distance between the measured and estimated travel times between arbitrary pairs of points in the network, assuming that trips between them most likely use the shortest paths. The hypothetical formulation would then be:  
\[ \begin{array}{c}\text{min}Z(\mathbf{X})=w_{1}F_{1}\big{(}\mathbf{Y},\hat{\mathbf{Y}} \big{)}+w_{2}F_{2}\big{(}\mathbf{X},\mathbf{X}^{\mathbf{H}}\big{)}+w_{3}F_{3}(\mathbf{t}\mathbf{ t},\hat{\mathbf{t}})\\ (\mathbf{Y},\ \mathbf{t}\mathbf{t})=Assignment(\mathbf{X})\\ \mathbf{X}\in\Omega\end{array}  \tag{1}\]  
Assuming, as in [9], that \(\mathbf{Y}(\mathbf{X})=Assignment(\mathbf{X})=\mathbf{A}(\mathbf{X})\mathbf{X}\), that is, the relationship between the estimated link flows and the estimated OD matrix, as defined by the assignment, can be formulated in terms of the assignment matrix \(\mathbf{A}(\mathbf{X})\) provided by the assignment, then the problem can be reformulated as:  
\[ \begin{array}{c}\text{min}Z(\mathbf{X})=w_{1}F_{1}\big{(}\mathbf{A}(\mathbf{X})\mathbf{X}, \hat{\mathbf{Y}}\big{)}+w_{2}F_{2}\big{(}\mathbf{X},\mathbf{X}^{\mathbf{H}}\big{)}+w_{3}F_{3 }(\mathbf{t}\mathbf{t},\hat{\mathbf{t}})\\ \mathbf{t}\mathbf{t}(\mathbf{X})=\mathcal{F}(\mathbf{X})\\ X\in\Omega\end{array}  \tag{2}\]  
However, the analytical relationship between the travel times \(\mathbf{t}\mathbf{t}\) and the estimated OD matrix \(\mathbf{X}\), namely, \(\mathbf{t}\mathbf{t}(\mathbf{X})=\mathcal{F}(\mathbf{X})\), either does not exist or is at least unclear, but in practice, when the assignment is a DTA, the travel times can be estimated from the DTA;  
where \(\hat{g}_{k}(\mathbf{X}_{k})\) is the gradient that is calculated during the \(k\)th iteration from the current estimation of the OD matrix \(\mathbf{X}_{k}\) and \(a_{k}\) is the step length along the gradient descent direction. SPSA (stochastic perturbation stochastic approximation) estimates the gradient \(\hat{g}_{k}(\mathbf{X}_{k})\) since it cannot be calculated analytically, calculating it numerically as:  
\[\hat{g}_{k}(\mathbf{X}_{k})=\frac{Z(\mathbf{X}_{k}+c_{k}\Delta_{k})-Z(\mathbf{X}_{k})}{c_{k }}\cdot\left( \begin{array}{c}\Delta_{k,1}^{-1}\\ \vdots\\ \Delta_{k,\ N}^{-1}\end{array} \right)=\left( \begin{array}{c}\frac{Z(\mathbf{X}_ {k}+c_{k}\Delta_{k})-Z(\mathbf{X}_{k})}{c_{k}\Delta_{k}^{2}}\\ \vdots\\ \frac{Z(\mathbf{X}_{k}+c_{k}\Delta_{k})-Z(\mathbf{X}_{k})}{c_{k}\Delta_{N}^{2}}\end{array} \right) \tag{5}\]  
where \(\Delta_{k}\) is a random perturbation N-dimensional vector with \(\Delta_{i},\ \forall i\), independent identically distributed random variables satisfying \(\mathbb{E}(\Delta_{i})=0\) and \(\left|\mathbb{E}\Big{(}\left(\Delta_{i}^{-1}\right)^{n}\Big{)}\right|<\infty, \ \forall n\). Note that only two evaluations are required.