## 4 Pairwise Clock Synchronization under Exponential Delays
### Clock Offset Estimation under Exponential Delays  
#### 4.1.1 Maximum Likelihood Estimator  
In the two-way message exchange mechanism Equation (4) where only clock offset exists, we assume that \(X_{i}\) and \(Y_{i}\) are exponentially-distributed random variables with means \(\lambda_{1}\) and \(\lambda_{2}\), respectively. Assuming a known fixed delay, [PERSON] [25] reported that the MLE of the clock offset does not exist when the exponential random delays are assumed to be known and symmetric, _i.e._, \(\lambda_{1}=\lambda_{2}=\lambda\)since the likelihood function does not admit a unique maximum. However, [PERSON] [28] derived a closed-form solution for the MLE of clock offset by assuming an unknown fixed delay and an unknown mean for the exponential delay. In this way, a joint estimation of \(\theta,d\) and \(\lambda\) can ensure a unique maximum of the likelihood function. Specifically, assuming symmetric exponential delays with a common mean \(\lambda\), the likelihood function for \([d,\theta,\lambda]^{T}\) is expressed as:  
\[p(U_{i},V_{i}|d,\theta,\lambda)=\lambda^{-2N}e^{-\left(\sum\limits_{i=1}^{N}U_ {i}+\sum\limits_{l=1}^{N}V_{i}-2 Nd\right)/\lambda}\times I[U_{(1)}\geq d+ \theta,V_{(1)}\geq d-\theta] \tag{7}\]  
where \(I[\cdot]\) denotes the indicator function. Let the first order statistics \(U_{(1)}\) and \(V_{(1)}\) denote the minimum values of observations \(\{U_{i}\}_{i=1}^{N}\) and \(\{V_{i}\}_{i=1}^{N}\), respectively. It can be shown that for fixed values of \(d\) and \(\theta\), the optimal value of \(\lambda\) that maximizes the likelihood function is given by \(\lambda=(\overline{U}+\overline{V})/2-d\). Therefore, the likelihood function Equation (7) can be simplified to:  
\[p(U_{i},V_{i}|d,\theta)=\left(\frac{\overline{U}+\overline{V}}{2}-d\right)^{- 2N}e^{-2N}\times I[U_{(1)}\geq d+\theta,V_{(1)}\geq d-\theta]\]  
It can be observed that the indicator function poses a high impact on the value of the likelihood function, and moreover, the indicator function depends on \(U_{(1)}\) and \(V_{(1)}\). Hence, in order to maximize the likelihood function, different assumptions on \(U_{(1)}\) and \(V_{(1)}\) are discussed in [28], e.g., \(U_{(1)}>V_{(1)}>0\), and the region where \(p(d,\theta|U_{i},V_{i})>0\) is illustrated separately for each assumption. The value of \(\theta\) that maximizes the likelihood function is found graphically from the corresponding support region. It is shown that all of the different assumptions on \(U_{(1)}\) and \(V_{(1)}\) lead to the same MLEs for the vector \([d,\theta,\lambda]^{T}\):  
\[\left[ \begin{array}{c}\hat{d}_{\text{ML}}\\ \hat{\theta}_{\text{ML}}\\ \hat{\lambda}_{\text{ML}}\end{array} \right]=\frac{1}{2}\left[ \begin{array}{ c}U_{(1)}+V_{(1)}\\ U_{(1)}-V_{(1)}\\ \overline{U}+\overline{V}-U_{(1)}-V_{(1)}\end{array} \right] \tag{8}\]  
Our primary interest is the MLE of the clock offset \(\hat{\theta}_{\text{ML}}=(U_{(1)}-V_{(1)})/2\), but in the meantime, the MLEs for \(d\) and \(\lambda\) are also derived. It can be verified that \(\hat{\theta}_{\text{ML}}\) is unbiased and has a variance \(\lambda^{2}/(2N)\). Interestingly, if \(d\) is unknown and the variable portions of delays are not symmetric, _i.e._, \(\lambda_{1}\
eq\lambda_{2}\), the MLE of \(\theta\) also admits the form \(\hat{\theta}_{\text{ML}}=(U_{(1)}-V_{(1)})/2\). However, in this case, the MLE is biased. Different from the graphical analysis used in [28, 29] analytically derived the MLE of clock offset under exponential delays using convex optimization tools. In particular, the system model in Equation (4) is re-written as:  
\[U_{i}=\xi+X_{i},\;\;V_{i}=\psi+Y_{i} \tag{9}\]  
where \(\xi\stackrel{{\triangle}}{{=}}d+\theta\) and \(\psi\stackrel{{\triangle}}{{=}}d-\theta\). The goal is to determine the MLEs of \(\xi\) and \(\psi\), _i.e._, \(\hat{\xi}_{\text{ML}}\) and \(\hat{\psi}_{\text{ML}}\), such that the MLE of \(\theta\) can be obtained from:  
\[\hat{\theta}_{\text{ML}}=\left(\hat{\xi}_{\text{ML}}-\hat{\psi}_{\text{ML}} \right)/2 \tag{10}\]based on the invariance principle [23].