## 2 Mathematical Model
### Bayesian Ridge Regression Model  
The Bayesian ridge regression model is a linear regression model, and its general expression has the following form:  
\[Y=\omega^{T}X+\varepsilon \tag{9}\]  
where \(\omega\) is the estimated random vector with a dimension of \(d\); \(X=\{x_{i}\}\) and \(Y=\{y_{i}\}\) represent the system input and output random variables, \(i=1\), \(2\), \(3\), \(\ldots\); \(n\) denotes the sample size; and \(\varepsilon\) is the random noise that follows a Gaussian distribution with a mean of \(0\) and variance \(\beta\). The prior distribution assumption for parameter \(\omega\) follows a Gaussian distribution:  
\[P(\omega)=N(0,\lambda^{-1}I) \tag{10}\]  
where \(I\) is the \(d\times d\) identity matrix, \(\lambda\) is a hyperparameter that controls the prior distribution density, and \(\lambda^{-1}I\) represents the variance of the corresponding Gaussian distribution. We assume that the conditional probability of the output variable \(Y\) also follows a Gaussian distribution, which leads to the likelihood function of \(\omega\):  
\[p(Y\mid\omega,X)=N(Y\mid\omega^{T}x,\sigma^{2}) \tag{11}\]  
where \(\sigma^{2}\) is the corresponding variance. From Equation (11), the posterior distribution of \(\omega\) can be computed using the Bayesian theorem, expressed as follows:  
\[p(\omega\mid x,Y)\propto p(Y\mid x,\omega)p(\omega) \tag{12}\]  
Based on the likelihood function and prior distribution, further derivation leads to the following outcome:  
\[p(\omega\mid x,Y)\propto\exp(-\frac{1}{2\sigma^{2}}{\sum\limits_{i=1}^{n}{(y_ {i}-\omega^{T}x_{i}-\varepsilon_{i})}^{2}})\exp(-\frac{\lambda}{2}\omega^{T}\omega) \tag{13}\]  
The logarithmic form of this expression is as follows:  
\[\ln p(\omega\mid x,y)\propto-\frac{1}{2\sigma^{2}}{\sum\limits_{i=1}^{n}{(y_ {i}-\omega^{T}x_{i}-\varepsilon_{i})}^{2}}-\frac{\lambda}{2}\omega^{T}\omega +const \tag{14}\]  
where \(const\) is a constant unrelated to \(\omega\). According to the Bayesian statistical principles, it is evident that the posterior distribution of \(\omega\) also follows a Gaussian distribution. This distribution is utilized for purposes involving the prediction and estimation of uncertainty. The optimal parameters \(\omega_{MAP}\) for Equation (14) are obtained by finding the extremum point. The resulting expression for \(\omega_{MAP}\) is as follows:  
\[\omega_{MAP}={(\lambda I+\frac{1}{\sigma^{2}}{\sum\limits_{i=1}^{n}{x_{i}x_{ i}^{T}}})}^{-1}\frac{1}{\sigma^{2}}{\sum\limits_{i=1}^{n}{x_{i}y_{i}}} \tag{15}\]  
where the matrix \({(\lambda I+\frac{1}{\sigma^{2}}{\sum\limits_{i=1}^{n}{x_{i}x_{i}^{T}}})}^{-1}\) is a \(d\times d\) matrix. The mean square deviation \(\sigma\) and the parameter \(\lambda\) satisfy a gamma distribution:  
\[\sigma \sim Ga(\alpha_{1},\alpha_{2}) \tag{16}\] \[\lambda \sim Ga(\beta_{1},\beta_{2}) \tag{17}\]  
In fitting the model, the joint estimation of parameters \(\omega\), \(\sigma\), and \(\lambda\) is typically regulated using the Maximum A Posteriori (MAP) estimation method. Specifically, while solving the \(\omega_{MAP}\), the noise variance \(\sigma\) is regarded as an unknown parameter, and the optimal estimates for \(\omega_{MAP}\), \(\sigma\), and \(\lambda\) are obtained by maximizing the posterior distribution [24; 25]. In this study's identification process, the standard equations of submarine motion are appropriately modified. Specifically, in Equation (1), the left-hand side represents the product of the mass matrix \(M\) and the acceleration matrix \(A\), while the right-hand side represents the external forces \(F\) acting on the submarine, which can be abbreviated as:  
\[M\cdot A=F \tag{18}\]Then, the Euler method is used to discretize Equation (18), providing the following expression:  
\[P(\omega)=N(0,\lambda^{-1}I) \tag{10}\]0  
where \(V=[u,v,w,p,q,r]^{T}\), \(\Delta t\) represents the discrete time step, and \(i\) denotes the sampling time step, \(i=0,1,2,\ldots\). By utilizing Equations (2) and (19), \(F\) can be obtained by solving for the force matrix using \(M\) and \(V\).