## 2 Methodology
### Description of the Machine Learning Algorithms
#### 2.2.1 Multivariate Regression  
In statistical analysis, researchers actively employ MVR to generate a relationship between the multiple independent variables \(x_{1},x_{2},x_{3},\ \ldots,x_{n}\), and a single dependent variable \(y_{i}\) ([PERSON], 1981) [51]. This technique holds significance in fields where several factors concurrently influence an outcome. MVR has been implemented in several fields and in the petroleum industry. Among others, [PERSON] et al. (2022) [21] applied the method on the field tripping-out dataset.  
In this paper, MVR related independent drilling variables/features to predict the target variable, y (ECD). The multiple linear regression model represented the linear combination of weighted features and is expressed as ([PERSON], 2003) [52]:  
\[y_{i}=\beta_{0}+\beta_{1}x_{1}+\ldots+\beta_{n}x_{n}+\varepsilon \tag{4}\]  
Here, \(y_{i}\) is a dependent variable representing ECD, while \(x_{1},x_{2},x_{3},\ldots\)\(x_{n}\) different surface and downhole parameters. In Equation (1), \(\beta_{0}\) represents the y-intercept (the value of y when all other independent variables are set to 0), \(\beta_{1}\) denotes the regression coefficient of the first independent variable \(x_{1}\), \(\beta_{n}\) represents the regression coefficient of the last independent variable \(x_{n}\), and \(\varepsilon\) is the model error (that describes the degree of variation from the estimate of \(y_{i}\)).  
The MVR equation can be represented in a concise framework that relates the target, regression variables, regression coefficients, and random errors in the form:  
\[y_{i}=X\beta+\varepsilon \tag{5}\]  
The model in matrix form can be represented as:  
\[\begin{bmatrix}y_{1}\\ y_{2}\\ \vdots\\ y_{N}\end{bmatrix}=\begin{bmatrix}1&x_{11}&\ldots&\ldots&x_{1M}\\ 1&x_{21}&\ldots&\ldots&x_{2M}\\ \vdots&\vdots&\vdots&\vdots&\vdots\\ 1&x_{N1}&\ldots&\ldots&x_{NM}\end{bmatrix}\begin{bmatrix}\beta_{0}\\ \beta_{1}\\ \vdots\\ \beta_{N}\end{bmatrix}+\begin{bmatrix}\varepsilon_{1}\\ \varepsilon_{2}\\ \vdots\\ \varepsilon_{N}\end{bmatrix} \tag{6}\]  
Here \(y_{i}\) represents a column vector of the observed values (ECD), \(X\) denotes a matrix of independent variables (each column represents a different drilling variable), \(\beta\) represents a column vector of coefficients, and \(\varepsilon\) a column vector of errors.  
The optimized set of coefficients. (\(\beta_{0}\), \(\beta_{1}\), \(\ldots\), \(\beta_{n}\)) that minimizes the sum of squared differences between the observed \(y_{i}\) and predicted values from the regression function is described in Equation (4).  
\[\text{SSR}=\min_{\beta_{0},\beta_{1},\ldots,\beta_{n}}\sum_{i=1}^{N}\left(y_{i }-(\beta_{0}+\beta_{1}X_{ii}+\beta_{2}X_{2i}+\ldots+\beta_{n}X_{ni})\right)^ {2} \tag{7}\]  
The solution involves minimizing the sum of squared errors, leading to the estimated coefficients:  
\[\widehat{\beta}=\left(X^{T}X\right)^{-1}X^{T}y_{i} \tag{8}\]  
Here, \(\widehat{\beta}\) is the vector of estimated coefficients \(\left(\widehat{\beta}_{0}\), \(\widehat{\beta}_{1}\), \(\ldots\), \(\widehat{\beta}_{n}\right)\), \(X^{T}\) is the transpose of matrix \(X\), and \(\left(X^{T}X\right)^{-1}\) is the inverse of the product of the transpose of \(X\) and \(X\).  
The estimated coefficients are plugged back into the original equation, yielding the final multiple regression equation:  
\[\widehat{E}\widehat{CD}=\widehat{\beta}_{0}+\widehat{\beta}_{1}X_{1}+\widehat {\beta}_{2}X_{2}+\ldots+\widehat{\beta}_{n}X_{n} \tag{9}\]