**4. Results**

In this section, the result of from the above three models is discussed and a window of the predicted and actual price is shown together with a graphical presentation. Finally, we assess how our model is performing by model diagnostics.

### *4.1. Autoregressive Integrated Moving Average*

### 4.1.1. ARIMA Model Result

The model *ARIMA*(0, 2, 1) in Equation (3) produces the prediction in a logarithmic scale, which is then converted back to the original scale by the formula Predicted Price = *<sup>e</sup>prediction*. Total 63 trading days have been predicted by the model and compared with the actual prices which has been shown in Table 4 with individual prediction error calculated by the formula,

$$\text{error} = \frac{\text{actual} - \text{predicted}}{\text{actual}} \times 100. \tag{12}$$

From Table 4, we see that the forecast errors are less than one dollar for the daily period from 12 November, 2019 to 30 December 2019, with the relative errors within the range of 0.00003 to 0.00292. Figure 6 shows the graphical representation of the actual and predicted stock price by the model. The black line represents the actual stock price and the red line represents the predicted stock price for S & P 500. Figure 6 also shows that the ARIMA (0,2,1) predicted prices follow closely to the trend of the actual prices.


**Table 4.** Prediction by ARIMA(0,2,1) model.

### 4.1.2. ARIMA Model Diagnostics

The performance of the *ARIMA(0,2,1)* model was assessed by the analysis of the four error measures state in Equation (1) and the residuals plot, which is depicted in Figure 7 and those four error measures are tabulated in Table 5.


**Table 5.** Prediction error by ARIMA(0,2,1) model.

From the results in Table 5, we see that all the error measures are comparatively very low to the actual prices, this indicates that the model is performing better in its prediction. From Figure 7 it is clear that the residuals do not follow any special pattern, they are a randomized plot. Correlations in the few lags are significant. Overall, the model fits very well to predict the stock price.

**Figure 6.** ARIMA (0,2,1) model prediction.

**Figure 7.** ARIMA(0,2,1) model residual analysis.
