# Regressed Terrain Traversability Cost for Autonomous Navigation Based on Image Textures
## 3 Traversability Cost Prediction
### Traversability Cost Regression using Gaussian Process (GP)  
The Gaussian process [25] is used for regression analysis. Let \(\mathcal{D}=\left\{(\mathbf{x}_{j},y_{j}),j=1,\cdots,n\right\}\) denote a set of training samples with pairs of SFTA feature vector inputs \(\mathbf{x}_{j}\) and motion feature outputs \(y_{j}\in\mathbb{R}\), and \(n\) denotes the total number of training samples. The goal is to evaluate the predictive distribution for the function \(f_{\mathbf{*}}\) for test input samples \(\mathbf{x}_{\mathbf{*}}\). The noise is additive and independent and following a normal distribution. The relationship between the function \(f(\mathbf{x})\) and the observed noisy targets \(y\) is given by  
\[y_{j}=f(\mathbf{x}_{j})+\varepsilon_{j}, \tag{15}\]  
where \(\varepsilon_{j}\) is noise with distribution \(\mathcal{N}(0,\sigma_{\text{noise}}^{2})\), in which \(\sigma_{\text{noise}}^{2}\) denotes the variance of the noise. The notation \(\mathcal{N}(\mathbf{a},A)\) is retained for the normal distribution with mean \(\mathbf{a}\) and covariance \(A\). The Gaussian process regression is a Bayesian algorithm that assumes that _a priori_ the function values respond as  
\[p(\mathbf{f}|\mathbf{x}_{1},\mathbf{x}_{2},\cdots,\mathbf{x}_{n})=\mathcal{N}(0,K), \tag{16}\]  
where \(\mathbf{f}=[f_{1},f_{2},\cdots,f_{n}]^{\top}\) contains the latent function values, \(f_{j}=f(\mathbf{x}_{j})\) and \(K\) is a covariance matrix of which inputs are provided by the covariance function defined as \(K_{ij}=k(\mathbf{x}_{i},\mathbf{x}_{j})\). A widely employed covariance function is the squared exponential given by  
\[K_{ij}=k(\mathbf{x}_{i},\mathbf{x}_{j})=\sigma^{2}\exp\left(-\frac{\left(\mathbf{x}_{i}- \mathbf{x}_{j}\right)^{\top}\left(\mathbf{x}_{i}-\mathbf{x}_{j}\right)}{2\lambda^{2}} \right), \tag{17}\]  
where \(\sigma^{2}\) controls the variance, and \(\lambda\) is the isotropic length scale parameter describing the smoothness of a function. We compute the covariance function among all possible combinations of data points using the following equations:  
\[K=\begin{bmatrix}k(\mathbf{x}_{1},\mathbf{x}_{1})&k(\mathbf{x}_{1},\mathbf{x}_{2})&\cdots&k( \mathbf{x}_{1},\mathbf{x}_{n})\\ k(\mathbf{x}_{2},\mathbf{x}_{1})&k(\mathbf{x}_{2},\mathbf{x}_{2})&\cdots&k(\mathbf{x}_{2},\mathbf{x}_{ n})\\ \vdots&\vdots&\ddots&\vdots\\ k(\mathbf{x}_{n},\mathbf{x}_{1})&k(\mathbf{x}_{n},\mathbf{x}_{2})&\cdots&k(\mathbf{x}_{n},\mathbf{x}_{ n})\end{bmatrix} \tag{18}\]  
\[K_{*}=\begin{bmatrix}k(\mathbf{x}_{*},\mathbf{x}_{1})&k(\mathbf{x}_{*},\mathbf{x}_{2})&\cdots &k(\mathbf{x}_{*},\mathbf{x}_{n})\end{bmatrix} \tag{19}\]  
\[K_{**}=k(\mathbf{x}_{*},\mathbf{x}_{*}). \tag{20}\]  
Figure 12: Data acquisition.  
The joint prior distribution of the training outputs, \(\mathbf{y}\), and the test outputs \(y_{*}\) according to the prior is  
\[\begin{bmatrix}\mathbf{y}\\ y_{*}\end{bmatrix}\sim\mathcal{N}\left(0,\begin{bmatrix}K&K_{*}^{T}\\ K_{*}&K_{**}\end{bmatrix}\right). \tag{21}\]  
The predictive distribution of the latent function for Gaussian Process Regression, \(y_{*}\), is given by \(y_{*}\sim\mathcal{N}(\overline{y}_{*},\sigma_{y_{*}}^{2})\) where:  
\[\overline{y}_{*}=K_{*}K^{-1}\mathbf{y} \tag{22}\]  
\[\sigma_{y_{*}}^{2}=K_{**}-K_{*}K^{-1}K_{*}^{T}. \tag{23}\]