## 4 Routes Knowledge Exploitation
### Route Classification
The prior \(P(R_{c}^{k})\) can be empirically evaluated as the ratio of the number of vessels that transited along the route, \(R_{c}^{k}\), over the total number of vessels detected in the area of interest. The likelihood, \(P(\textbf{V},\bar{\textbf{S}}|R_{c}^{k})\), accounts for the joint probability of the time series, **V**, of the observations and the sequence of the states, \(\bar{\textbf{S}}\), compared to the route, \(R_{c}^{k}\). Similarly to the probabilistic approach in the Hidden Markov Model (HMM) literature [44] and in the spatio-temporal trajectory mining literature (see, e.g., [45, 46]), the joint probability, \(P(\textbf{V},\bar{\textbf{S}}|R_{c}^{k})\), of the vessel track, **V**, and states sequence, \(\bar{\textbf{S}}\), given the route, \(R_{c}^{k}\), can be written as follows:  
\[P(\textbf{V},\bar{\textbf{S}}|R_{c}^{k})=P(\textbf{V}|\bar{\textbf{S}},R_{c}^ {k})P(\bar{\textbf{S}}|R_{c}^{k}) \tag{5}\]  
the sequence of states, \(\bar{\textbf{S}}\), being fixed, once the track sequence, **V**, has been observed. Similar interesting examples can be found in signal processing [47], video tracking [15] and maritime surveillance applications [48]. The probability, \(P(\textbf{V}|\bar{\textbf{S}},R_{c}^{k})\), of the observation sequence, **V**, for the state sequence, \(\bar{\textbf{S}}\), given the route, \(R_{c}^{k}\), can be expressed as follows:  
\[P(\textbf{V}|\bar{\textbf{S}},R_{c}^{k})=\prod_{t=1}^{T}P(\textbf{v}_{t}| \textbf{s}_{t},R_{c}^{k}) \tag{6}\]In Equation (6), the probability of observing a feature vector, \(\mathbf{v}_{t}\), in one state, \(\mathbf{s}_{t}\), is assumed to be independent of the feature vectors in other states. This is an approximation, since the feature vectors of the track, \(\mathbf{V}\), are related to the same vessel and, hence, are interdependent. Nevertheless, this approximation has been adopted elsewhere (see, e.g., [47]) with satisfying results. The generic \(P(\mathbf{v}_{t}|\mathbf{s}_{t},R^{k}_{c})\) is the probability of observing the feature vector, \(\mathbf{v}_{t}\), given the elements, \(\{R^{k}_{c}(\ell). [x,y,\dot{x},\dot{y}]\}\), of the route, \(R^{k}_{c}\), within the state region, \(\mathbf{s}_{t}\), defined as follows:  
\[\{R^{k}_{c}(\ell).[x,y,\dot{x},\dot{y}]\}\ \ \ \text{where}\ \ \|R^{k}_{c}(l).[x,y]-[x_{t},y_{t}]\|\leq d,\ \ \forall l\in\ell \tag{7}\]  
The probability, \(P(\mathbf{v}_{t}|\mathbf{s}_{t},R^{k}_{c})\), is calculated as:  
\[P(\mathbf{v}_{t}|\mathbf{s}_{t},R^{k}_{c})=P(x_{t},y_{t},\dot{x}_{t},\dot{y}_{ t}|\mathbf{s}_{t},R^{k}_{c})=P(\dot{x}_{t},\dot{y}_{t}|x_{t},y_{t},\mathbf{s}_{t},R^ {k}_{c})P(x_{t},y_{t}|\mathbf{s}_{t},R^{k}_{c}) \tag{8}\]  
where \(P(\dot{x}_{t},\dot{y}_{t}|x_{t},y_{t},\mathbf{s}_{t},R^{k}_{c})\) is the probability of observing the velocity components, \(\dot{x}_{t}\) and \(\dot{y}_{t}\), within the state, \(\mathbf{s}_{t}\), as identified by the neighbors of the current position, \([x_{t},y_{t}]\), within a distance, \(d\). This conditional probability takes into account the velocity dependency on the area where the vessel is actually observed. In other words, this component tells us the extent to which the vessel velocity vector is in line with the historical speed and direction local frequency distributions, given the route, \(R^{k}_{c}\). Given that the state, \(\mathbf{s}_{t}\), is identified by the observed position, \([x_{t},y_{t}]\), the probability, \(P(\dot{x}_{t},\dot{y}_{t}|x_{t},y_{t},\mathbf{s}_{t},R^{k}_{c})\), can be simplified as \(P(\dot{x}_{t},\dot{y}_{t}|\mathbf{s}_{t},R^{k}_{c})\). Both \(P(\dot{x}_{t},\dot{y}_{t}|\mathbf{s}_{t},R^{k}_{c})\) and \(P(x_{t},y_{t}|\mathbf{s}_{t},R^{k}_{c})\) can be estimated using, e.g., non-parametric methods, such as the Kernel Density Estimator, as discussed in Section 3.