## 3 Methodology
### Testing and Relaxing the Classical Assumptions
#### 3.3.6 Diagnostics of the Normality Assumption  
The normality assumption (that the error variable is normally distributed) affects the quality of the interval parameter estimates in the MLR models. Let us test the null hypothesis \(H_{0}\) (that the error variable is normally distributed) against the alternative hypothesis \(H_{1}\) (that the error variable is non-normally distributed):  
\[H_{0}\colon\varepsilon\sim N\Big{(}0,\sigma_{\varepsilon}^{2}\Big{)}\text{ against }H_{1}\colon\varepsilon\sim N\Big{(}0,\sigma_{\varepsilon}^{2}\Big{)} \tag{47}\]  
The square of the standard error estimate (17) is a consistent estimator of the error variance, \(\sigma_{\varepsilon}^{2}\), which is even non-biased when OLS is used. However, using the former implies that the OLS residuals (15) should be used in testing (43). Since the OLS residuals are not homoscedastic variates, we prefer to use the predicted residual (21) as \(n\) variates of the error variable, \(\varepsilon\). Therefore, the sample variance of the predicted residuals (48) will be used as a better estimator of the error variance, \(\sigma_{\varepsilon}^{2}\):  
\[\hat{\sigma}_{\varepsilon,HO}^{2}=\frac{1}{n-p-1}\sum_{i=1}^{n}(e_{i,H\Omega}- \ \vec{v}_{HO})^{2}\,\text{ where }\vec{v}_{HO}=\frac{1}{n}\sum_{i=1}^{n}e_{i,HO} \tag{48}\]  
To test the normality, we reformulate the hypotheses in (47) and use (49) instead:  
\[H_{0}\colon\varepsilon\sim N\Big{(}0,\hat{\sigma}_{\varepsilon,HO}^{2}\Big{)} \text{ against }H_{1}\colon\epsilon\sim N\Big{(}0,\hat{\sigma}_{\varepsilon,HO}^{2}\Big{)} \tag{49}\]  
As a by-product of using (49) we have decoupled the questions \"Is the error variable normal?\" and \"What is the variance of the error variable?\". The test (49) will correctly answer only the first question. We have modified the Jarque-Bera Monte-Carlo test (39) (pp. 148-149) to solve the problem (49) by using \(JB_{stat}\) as a test statistic, which implements unbiased estimates for the skewness and the kurtosis:  
\[JB_{stat}=\frac{\sqrt{n^{2}-n}\sum\limits_{i=1}^{n}\left(e_{i,HO}- \ \frac{1}{n}\sum\limits_{i=1}^{n}e_{i,HO}\right)^{3}}{6(n-2)\sqrt{\hat{\sigma}_{ \varepsilon,HO}^{3}}}+\frac{n}{24}\left[\frac{(n-1)\sum\limits_{i=1}^{n}\left( e_{i,HO}-\ \frac{1}{n}\sum\limits_{i=1}^{n}e_{i,HO}\right)^{4}}{n(n-2)(n-2)\hat{\sigma}_{ \varepsilon,HO}^{4}}-3\right]^{2} \tag{50}\]  
The \(p\)-value of the test (49) is calculated using the Monte-Carlo procedure below. ```
1. Select the significance level \(\alpha\) of the modified Jarque-Bera Monte-Carlo test (\(\alpha=0.05\))
2. Select the count, \(N\), of the Monte-Carlo replicas (\(N=10,\!000\))
3. Calculate the test statistics, \(JB_{stat}\), using (50)
4. Initialize the count of the extreme variates \(M=0\)
5. Repeat \(N\) times the following steps:

(5a) Sample \(n\) independent variates, \((l_{1},l_{2},\ldots,l_{n})\) from \(N\Big{(}0,\hat{\sigma}_{\varepsilon,HO}^{2}\Big{)}\)

(5b) Calculate the test statistics, \(JB_{stat,pr}\), in the current pseudo-reality using:

\[JB_{stat,pr}=\frac{\sqrt{n^{2}-n}\sum\limits_{i=1}^{n}\left(l_{i}-\ \frac{1}{n}\sum\limits_{i=1}^{n}l_{i}\right)^{3}}{6(n-2)\sqrt{\hat{\sigma}_{ \varepsilon,HO}^{3}}}+\frac{n}{24}\left[\frac{(n-1)\sum\limits_{i=1}^{n}\left( l_{i}-\frac{1}{n}\sum\limits_{i=1}^{n}l_{i}\right)^{4}}{n(n-2)(n-2)\hat{\sigma}_{ \varepsilon,HO}^{4}}-3\right]^{2}\]

(5c) If \(JB_{stat,pr}>JB_{stat}\), then \(M=M+1\)

6. Set the \(p\)-value of the test as \(p\)-value\(j_{B}=M/N\)

7. If \(p\)-value\(j_{B}<\alpha\), then declare that there is not enough statistical evidence to claim that the error variable is non-normally distributed

8. Declare that the error variable is non-normally distributed
```  
**Algorithm 4**Calculation of \(p\)-value of the Jarque-Bera Monte Carlo test  
For the correct application of a \(t\)-test we also need a valid normality assumption. Luckily, the \(t\)-test conclusions are jeopardized only when the error variables have very nonnormal distribution, like being multimodal or highly skewed.