## 4 Routes Knowledge Exploitation
### Route Classification
The other term in Equation (5) is the probability, \(P(\bar{\mathbf{S}}|R^{k}_{c})\), of the state sequence, \(\bar{\mathbf{S}}\), given the route, \(R^{k}_{c}\), and can be decomposed as follows:  
\[\textbf{v}_{t}=[x_{t},y_{t},\dot{x}_{t},\dot{y}_{t}]^{\intercal} \tag{2}\]0  
where the proportionality follows from the assumption that the initial state probability, \(P(\mathbf{s}_{1}|R^{k}_{c})\), is equal for all the possible state sequences in \(R^{k}_{c}\). In other words, the sequence is equally probable to start at any point of the route. The Equation (9) accounts for the compatibility of the state sequence, \(\{\mathbf{s}_{t-1},\mathbf{s}_{t}\}\), to the route, \(R^{k}_{c}\), and takes into account the high variability of AIS refresh rates, as discussed in Section 3. This can be estimated as a function of the distance, \(\Delta_{p}\), between the observed position, \([x_{t},y_{t}]\) (which is the center of the neighborhood \(\mathbf{s}_{t}\)), and the predicted position, \([\hat{x}_{t},\hat{y}_{t}]\), calculated by propagating \([x_{t-1},y_{t-1}]\) to the current time, \(t\), given the velocity distribution along the route, \(R^{k}_{c}\), as described in the track predictor in Algorithm 4--Track Predictor (contained in Anne A)--where \(\lceil\cdot\rceil\) is the ceiling function and \(\delta_{t}\) is a rough time increment between two positions. The time increment can be conveniently chosen, depending on the complexity of the route (see [32]). The distance, \(\Delta_{p}\), can be used to estimate the likelihood of observing the state, \(\mathbf{s}_{t}\), given the previous state, \(\mathbf{s}_{t-1}\), and the route, \(R^{k}_{c}\). \(\Delta_{p}\) can be regarded as a random variable describing the prediction error, _i.e._, the displacement of the current observed position, with respect to the expected one, given a time lag, \(\Delta_{t}\), between the observations and a compatible route, \(R^{k}_{c}\). Thus, the distance, \(\Delta_{p}\), is ultimately calculated as the Euclidean distance, \(\Delta_{p}=\|[x_{t},y_{t}]-[\hat{x}_{t},\hat{y}_{t}]\|\), since most observed distances are generally below eight nautical miles, with a reduced curvature effect. In order to investigate the variability of \(\Delta_{p}\), a parametric model has been selected from the literature and analyzed. Typically, survival distributions are used to estimate time-to-event. These functions are appropriate, because the radial distance-to-event can be regarded as analogous to time-to-event. Exponential-like models show goodness of fit and also conform with some related literature (see, e.g., [12, 49, 50]). Among them, the Weibull model has been selected, since it shows good correlation with the empirical distributions of the observed distances on real AIS data streams in different areas. As a result, the transition probability, \(P(\mathbf{s}_{t}|\mathbf{s}_{t-1},R_{c}^{k})\), can, then, be expressed as follows:  
\[\textbf{v}_{t}=[x_{t},y_{t},\dot{x}_{t},\dot{y}_{t}]^{\intercal} \tag{2}\]1  
The shape parameter, \(\beta_{k}\), basically does not change with time, while the scale parameter, \(\alpha_{k}\), is assumed to depend on the time window, \(\Delta_{t}\), between two subsequent observations as follows:  
\[\textbf{v}_{t}=[x_{t},y_{t},\dot{x}_{t},\dot{y}_{t}]^{\intercal} \tag{2}\]2  
for \(\Delta_{t}>0\). So, the expected value for the random variable, \(\Delta_{p}\), is:  
\[\textbf{v}_{t}=[x_{t},y_{t},\dot{x}_{t},\dot{y}_{t}]^{\intercal} \tag{2}\]3  
and the variance is equal to:  
\[\textbf{v}_{t}=[x_{t},y_{t},\dot{x}_{t},\dot{y}_{t}]^{\intercal} \tag{2}\]4  
where \(\Gamma\) is the Gamma function. Due to Equation (11), the variance increases with \(\Delta_{t}^{2}\), accounting for the growth of uncertainty related to the propagation model in long-term prediction, as typical of diffusion models.