## 3 Methodology
### Testing and Relaxing the Classical Assumptions
#### 3.3.5 Diagnostics of the Homoscedasticity Assumption
Using the above considerations, we propose a modified heteroskedasticity testing and relaxing algorithm (MHTRA), given below. In MHTRA, we utilize ideas from the Glejser homoscedasticity test [36] (pp. 162-163). This regresses the absolute OLS residuals, instead of the squared OLS residuals and produces estimates of the standard deviation of the error variable instead of the variance of the error variable. This is advantageous because the regressors (4) have been selected by the statistician to be linearly connected to the dependent variable which probably will produce linearity with the standard deviation of the error variable (the last two share the same unit of measurement, unlike the variance of the error variable). The main improvement from the Glejser homoscedasticity test is that MHTRA uses better proxies (predicted residuals instead of OLS residuals). MHTRA has also taken inspiration from the White homoscedasticity test [51], where the model for the auxiliary regression for the variance of the error variable uses as regressors all the original regressors, their cross products and their squares or the regressors in the original model. This test, similar to MHTRA, assumes homoskedasticity if the auxiliary regression is not a valid model. The main improvementsfrom the White homoscedasticity test are that MHTRA deals with practically negligible statistically significant heteroscedasticity and that the regressors of MHTRA are only the original regressors that are changing during the execution of MSRA. The latter avoids the danger of exhausting the degrees of freedom in the White test, which can easily produce an auxiliary regression with \(p>n\). **Algorithm 3: Modified heteroskedasticity testing and relaxing algorithm (MHTRA) for the MLR model**  
1. Calculate the \(p\) regressors of the current MLR model for each record in the dataset using (8) for \(i=1,\,2,\,\ldots\,\), \(126\) and \(j=1,\,2,\,\ldots\,\), \(p\)
2. Form the initial [\(126\times p\)]-dimensional design matrix \(X\) using (10) and the 126-dimensional vector of the observed values \(\overset{\rightarrow}{y}\) using (9)
3. Select the significance level \(x=0.05\) of the \(F\)-test
4. Build the OLS regression (14) using the data in \(\mathbf{X}\) and \(\overset{\rightarrow}{y}\)
5. Calculate the resubstitution OLS  
The MHTRA is a useful algorithm, but it still will not provide advice in the case when the model is heteroscedastic, although we cannot identify the proper weights because the auxiliary model for residuals has a low adjusted coefficient of determination (e.g., \(R_{adj}^{2}<0.25\)). The right approach is provided in [51] where a heteroscedasticity-consistent covariance matrix of the model's parameters, \(\overset{\rightarrow}{b}\), is proposed. It is proven that Formulas (17) and (18) are not unbiased estimates of the covariance matrix, \(\mathbf{K}_{\overset{\rightarrow}{b}}^{\ast}\) in case of heteroscedasticity. The problem is traced back to the classical assumptions, which under homoskedasticity implies that there is only one error variable error \(\varepsilon\). Instead, when the model is heteroscedastic there are \(n\) different error variables \(\varepsilon_{i}\) (for \(i\)=1, 2,..., \(n\)), one for each record in the training set as shown in (11). Each has its own variance, \(V\left[\varepsilon_{i}\middle|\overset{\rightarrow}{x}\right]=\sigma_{ \varepsilon_{i}}^{2}\). It is convenient to organize the \(n\) error variables in a random vector \(\overset{\rightarrow}{\xi}=\left(\varepsilon_{1},\varepsilon_{2},\ldots, \varepsilon_{n}\right)^{T}\). Even when the correlation assumption holds, the heteroscedasticity causes the covariance matrix of \(\overset{\rightarrow}{\varepsilon}\) to be diagonal rather than scalar (with \(\hat{\sigma}_{e}^{2}\) on the main diagonal, as the classical assumptions require):  
\[\mathbf{K}_{\overset{\rightarrow}{x}}=diag\Big{(}\sigma_{\varepsilon_{1}}^{2}, \sigma_{\varepsilon_{2}}^{2},\ldots,\sigma_{\varepsilon_{n}}^{2}\Big{)} \tag{43}\]  
Several estimators of (43) are proposed.