## 4 Simulation Results and Analysis  
To evaluate the performance and position accuracy of our proposed LSTM model, we used the MATLAB R2019b (MathWorks, 1 Apple Hill Dr, Natick, MA 01760, United States, 2019) simulation environment with all built in tools. We simulated an experiment area with UWB anchors and a tag. Figure 9 indicates the UWB anchors and tag positions from a MATLAB simulation. In Figure 9, the starting position of the UWB tag is defined as (0, 2) and moved the UWB tag at a constant speed. We placed three anchors in the simulation environment based on the UWB tag motion. The positions of the anchors depend on the UWB tag motion and which covers the simulation environment. The UWB tag communicates with three anchors and estimates the tag distance from all anchors. The small circles in the Figure 9 show the anchor positions and the black star marks indicate the UWB tag motion. We moved the UWB tag in a random position based on a rectangular motion. The TOA-distance model from the simulation estimates the distances for all tag positions in the experiment area and used the distances as training data. The data sample consists of 2582 samples with three distance and user \(x\) and \(y\) position values. Seventy-five percent of data samples were used for training the model and 25% samples used in testing. The LSTM model uses three input neurons for the three distance values from anchors and two output neurons to predict the user \(x\) and \(y\) positions. The performance of proposed LSTM model was analyzed in terms of learning rate, optimizer, loss function, batch size, number of hidden nodes and timesteps. Figure 10 shows the localization accuracy of training data with varies learning rates. Figure 8: Model structure of proposed LSTM networks. From Figure 10, it can be seen that the accuracy of the system increases with a lower learning rate. For large learning rates, the model tends to be unstable during training and with very low rates, the system fails to train the model. To compensate for these issues, we simulated different learning rates and obtained the optimum learning rate for training the model through a process called hyperparameter tuning. In our simulation, we selected 0.0001 value as learning rate for training the model. The selected learning rate controls how much the model responds to the output error when the model weights are updated. Next, we analyzed the significance of different optimizers for the LSTM model. The optimizers play a very crucial role to increase the accuracy of the model. When we consider deep neural networks for localization, the neural networks have the tendency to either vanish or explode as the energy is propagated through the function. When the function is more complex, the network performs worse due to the cumulative nature. To avoid the vanishing and exploding gradient issue, we use a suitable optimizer and it is necessary to identify the best optimizer for localization. In our simulation we analysed the performance of the stochastic gradient descent (SGD), Root Mean Square Propagation (RMSProp), adaptive gradient algorithm (Adagrad), adaptive moment estimation (Adam), nesterov-accelerated adaptive moment estimation (Nadam), Adadelta and Adamax. Figure 11 shows the performance of these different optimizers for the LSTM model. From Figure 11, the Nadam optimizer gives best localization accuracy and a lower loss value when compared to other optimizers. The SGD and Adadelta shows the worst performance. The optimizers Adam, Adamax, Adagrad and RMSProp are very similar algorithms and RMSProp was found to slightly outperform the other optimizers. Next, we consider the effect of different loss functions for the LSTM model. The loss function used in the deep leaning model reduces the error in the prediction. For the regression loss function, networks use mean squared error loss (MSE), mean squared logarithmic error loss (MSLE) and mean absolute error loss (MAE).