# Jakarta Pandemic to Endemic Transition: Forecasting COVID-19 Using NNAR and LSTM
## 3 Results
### Nnar  
Neural Network Auto-Regressive (NNAR) consists of three layers. There is one input layer, one output layer, and one hidden layer. The number of neurons in this input layer is determined by the PACF plot at significant values.  
In the autoregressive process, the input or predictor used is historical data. The number of predictors is selected by looking at the significant lag in the ACF plot. A significant lag indicates an autocorrelation or relationship between the data and over time. Figure 3 shows a significant lag in the 1 st, 2 nd, 3 rd, 5 th, 6 th, 8 th, 9 th, 11 th, 12 th, 13 th, 15 th, 18 th, 20 th, 24 th, and 27 th lags. As input neurons, as many as 27 lags will be used in this analysis. In addition, the number of neurons in the hidden layer is determined by trial and error. The number of neurons analyzed starts from 5 to 31 neurons with a learning rate of 0.01 and a step max of 100,000. The analysis of the number of hidden layer neurons shows that 28 neurons for the hidden layer produce the smallest MSE, which is 0.00318.  
Moreover, the learning rate was also determined by trial and error, starting from a learning rate of 0.001 to 0.2 with 28 hidden neurons. The results show that a learning rate of 0.01 produces the smallest MSE value, which is 0.00318. Thus, the best model for confirmed positive cases of COVID-19 is NNAR (27,28,1) with a learning rate of 0.01, 100,000 step max, and ten repetitions.  
Figure 4 shows the plot of actual data layered by predicted data obtained using the NNAR model (27,28,1). Furthermore, the plot indicates that the predicted data almost follows the actual data. It means that the prediction model can predict the confirmed positive cases of COVID-19 in the future. Additionally, it is supported by the MAE value of 298.142, RMSE of 453.75, and the R Square value of 0.939.  
The same as the network in the confirmed positive cases of COVID-19, the network architecture in the analysis using the neural network method in the case of death due to COVID-19 also consists of three layers (one input layer, one output layer, and one hidden layer). Figure 5 shows the number of neurons in this input layer is determined by the PACF plot at significant values.  
Figure 4: A plot of actual data and predicted data for daily confirmed positive cases of COVID-19 in Jakarta.  
Figure 3: PACF Plot for Daily Confirmed Positive Cases of COVID-19 Data in Jakarta.  
Figure 5 shows that there is a significant lag in the 1 st, 2 nd, 3 rd, 4 th, 5 th, 7 th, 9 th, 11 th, 12 th, 15 th, 16 th, 17 th, 18 th, 19 th, 22 nd, and 24 th lags. In this analysis, 24 lags will be used as input neurons.  
Moreover, the number of neurons in the hidden layer and the learning rate are determined by a trial-and-error process. The number of neurons in the hidden layer will be analyzed starting from 5 to 28 neurons, while the learning rate will be analyzed starting from a learning rate of 0.001 to 0.2. The results show that a network with 24 neurons in the input layer, nine neurons in the hidden layer, and a learning rate of 0.01 produces the smallest MSE value, which is 0.001019. Thus, Figure 6 shows the best model results for death cases caused by COVID-19 are NNAR (24,9,1) with a learning rate of 0.01, 100,000 step max, and two repetitions.  
Figure 6 shows the actual data plot and the predicted data using the NNAR model (24,9,1). The plot indicates that the predicted data are almost in accordance with the actual data. It means that the prediction model can be used to forecast the death cases due to COVID-19 in Jakarta in the future. In addition, it is supported by the MAE of 6.41, RMSE of 9.41, and the R Square value of 0.8417.  
Figure 5: PACF plot for death cases caused by COVID-19 in Jakarta.  
Figure 6: A plot of actual data and predicted data on death cases due to COVID-19 in Jakarta.