## 4 Link Quality Estimator Model Based on ANFIS)  
Based on our experimental study of temporal variations in the quality of on-body links, described in the previous section, we have proposed a model based on ANFIS (Adaptive Neuro-Fuzzy Inference System) to predict the link quality variations in terms of RSSI. This model has been named the link quality estimator model based on ANFIS (A-LQE). The A-LQE model involves the interaction of input parameters related to the sensor node location (upper or lower body link), the transmission power levels available in the radio, as well as the movement, shape and composition of the human body. This RSSI-prediction model is subsequently used in our proactive policy for the transmission power control.  
Below, we shortly describe the A-LQE model; a more profuse description and motivation of the model can be found in [7]. In this paper, we will further exploit the proposed model to develop two reactive and proactive policies for transmission power control, which have been validated in a realistic simulation scenario. Given the complexity of finding an exact analytical formula to predict the RSSI values and in order to build a reasonable model, we have followed a three-phase approach, which is explained next.  
* Phase I, feature selection: Once the experimental data have been collected, overall 12 and 13 human body variables are available as input parameters for the models of Link 1 and Link 2, respectively. From the statistical analysis described previously in the Section 3, we selected a set of three and five preliminary variables for each one of the link models.
* Phase II, choice of A-LQE architecture: To assure that the selected input variables are meaningful and descriptive of the output variable (RSSI), we constructed ANFIS models for various combinations of input variables, and then, we chose the one with the best performance (lowest RMSE). The ANFIS models were trained with 1,036 vectors of input data, collected during the experimental work. Seven hundred twenty four vectors (70%) were randomly chosen for the training set, 156 (15%) vectors for testing set and the other 156 (15%) vectors for the validation set. The generalization capability of the models is assured by the proper selection of a large training set. Furthermore, 100 epochs and a training error tolerance of 0.0001 were specified for the training process to assure the achievement of the minimum error tolerance. The performance of the networks is assured for high values of the absolute fraction of variance (\(R^{2}\)), low values of the mean absolute error (MAE) and low values of the root mean squared error (RMSE). Table 3 shows the best ANFIS models obtained for both links. For Link 1, the model includes four input parameters: transmission power (Ptr), body position (BPosition), body fat mass (BFM) and mid-upper arm circumference (MUAC). This model has five membership functions of a Gaussian type for every input variable, five rules and one linear output. For Link 2, the model includes three input parameters: transmission power (Ptr), body position (BPosition) and lower leg length (LLL). This model has two membership functions of a triangular type for every input variable, eight rules and one linear output.  
* Phase III, validation: For the testing dataset, the validation of the predictive accuracy of the models is analyzed through RMSE, MAE and the average percentage error (APE). From these results, our A-LQE models show satisfactory results with a low APE of 5% and 4.6% for Link 1 and Link 2, respectively.