## 3 Methodology
### Testing and Relaxing the Classical Assumptions
#### 3.3.5 Diagnostics of the Homoscedasticity Assumption  
The homoskedasticity assumption (that the variance of the error variable is constant for any combination of independent variables, \(\overrightarrow{x}\)) affects the quality of the parameter estimates in MLR models. Luckily, even if the model is heteroskedastic (i.e., the homoskedasticity assumption does not hold) the OLS point estimates (27) of the parameter vector are still consistent and unbiased, although not efficient anymore [47]. However, if we have a model, \(V\big{[}\varepsilon\big{]}\overrightarrow{x}\big{]}=f\left(\overrightarrow{x}\right)\), to predict the variance of the error variable, as a (possibly stochastic) function of the vector of independent input \(\overrightarrow{x}=(K,B,d,D,\theta)^{T}\), then we can improve the estimates (27) by substituting them with the weighted least square (WLS) estimates \(\overrightarrow{b}_{WLS}=\big{(}b_{1,WLS},b_{2,WLS},\ldots,b_{p,WLS}\big{)}^{T}\) that happened to be BLUE. For any record in the dataset \(\left\langle\overrightarrow{x}_{i},y_{i}\right\rangle\), we can calculate the variance of the error variable:  
\[\vartheta_{e,i}^{2}=V\Big{[}\epsilon\big{|}\overrightarrow{x}_{i}\Big{]}=f \Big{(}\overrightarrow{x}_{i}\Big{)}=1/w_{i}^{2}\,\text{for}\ i=1,2,\ldots,n \tag{34}\]  
In (34), \(w_{i}\) is known as the weight of the \(i^{\text{th}}\) observation in the dataset. The weights can be organized in a square \([n\times n]\)-dimensional diagonal weight matrix \(\mathbf{W}\), where \(\mathbf{W[}i,i\mathbf{]}\) = \(w_{i}\) for \(i\) = 1, 2, \(\ldots,n\). Then, the WLS-estimates, \(\overrightarrow{b}^{\rightarrow WLS}=\left(b_{1}^{WLS},b_{2}^{WLS},\ldots,b_{p }^{WLS}\right)^{T}\), of the parameter vector, \(\overrightarrow{\beta}=\left(\beta_{1},\beta_{2},\ldots,\beta_{p}\right)^{T}\), can be found by minimizing the weighted sum of residuals:  
\[\overrightarrow{b}^{\rightarrow WLS}=\underset{\overrightarrow{\beta}}{arg\ min \left\{\sum_{i=1}^{n}w_{i}^{2}\bigg{[}y_{i}-\widetilde{y}_{i}\left( \overrightarrow{\beta}\right)\bigg{]}^{2}\right\}}=\underset{\overrightarrow {\beta}}{arg\ min\left\{\sum_{i=1}^{n}\left[\frac{y_{i}-\widetilde{y}_{i} \left(\overrightarrow{\beta}\right)}{\hat{\phi}_{e,i}}\right]^{2}\right\}} \tag{35}\]  
The identification of the coefficient estimates (35) is the essence of the WLS method. The optimization problem (35) has a closed solution [39] (pp. 947-948):  
\[\overrightarrow{b}^{\rightarrow WLS}=\Big{(}\boldsymbol{X}^{T}\boldsymbol{W}^{2} \boldsymbol{X}\Big{)}^{-1}\boldsymbol{X}^{T}\boldsymbol{W}^{2}\overrightarrow {y}=\sum_{ \begin{array}{c}j=1\\ s_{j}^{scor}>0\end{array} }^{p}\frac{\overrightarrow{u}_{j}^{\rightarrow*} \boldsymbol{W}\overrightarrow{y}}{s_{j}^{scor}}\overrightarrow{v}_{j}^{ \rightarrow*} \tag{36}\]  
Similarly to (25) and the discussion under it, the 126-dimensional vectors \(\overrightarrow{u}_{j}^{\rightarrow*}\) (for \(j\) = 1, 2, \(\ldots,p\)), the \(p\)-dimensional vectors \(\overrightarrow{v}_{j}^{\rightarrow}\) (for \(j\) = 1, 2, \(\ldots,p\)), and the singular values \(s_{j}^{*}\) (for \(j\) = 1, 2, \(\ldots,p\)) derive from the SVD decomposition of the scaled design matrix \(\boldsymbol{X}^{*}=\boldsymbol{W}\boldsymbol{X}\)[41] (pp. 333-335), whereas each of the corrected singular values \(s_{j}^{scor}\) are acquired using PCCSV. Plugging the point estimate of the parameter vector into (7) we can obtain the MLR model for hydrodynamic efficiency of the OWC WEC as required in Figure 2:  
\[\hat{y}^{WLS}=\sum_{j=1}^{p}b_{j}^{WLS}X_{j}=\sum_{j=1}^{p}b_{j}^{WLS}g_{j}(x_{ 1},x_{2},x_{3},x_{4},x_{5}) \tag{37}\]  
The resubstitution WLS residuals are calculated as in (15):  
\[\overrightarrow{e}^{WLS}=\Big{(}e_{1}^{WLS},e_{2}^{WLS},\ldots,e_{n}^{WLS} \Big{)}^{T}=\overrightarrow{y}-\boldsymbol{X}\overrightarrow{b}^{ \rightarrow WBS} \tag{38}\]  
We can adapt all the formulae in 3.2 to work with the WLS model (37) instead of the OLS model (14).