# Context-Driven Service Deployment Using Likelihood-Based Approach for Internet of Things Scenarios
## 5 Results and Discussion  
The system conducts its analysis by means of the MLE framework, which is generally used for density estimation with a supervised learning model. This provides the basis for the foundation of linear modeling techniques, such as linear regression for predicting numerical values and logistic regression for binary classification. In the case of linear regression, the model is constrained to a line, and this involves finding a set of coefficients for that line that best fit the observed data; hence, the problem can be solved analytically using linear algebra.  
Let us take a simple example as a test case for a toy simulation application at our lab. In this scenario, the users/nodes consume services infinitely often. The MLE helps to find the predicted probability of each service being used, and based on this, we designed the DR arrangements for the most likely/most frequently used services. For simplicity of discussion, we assume 02 atomic services (\(s_{1}\) and \(s_{2}\)). We also assume that in the service bucket(s) of the server(s), both services have an equal number of ready instances that can be served to a user/users on demand. The services can be consumed in any possible combination. As an instance, we assume \(s_{1}\) with 09 instances and \(s_{2}\) with 01 instances to be served for consumption. There are thus 10 possible consumption variations, as shown in Figure 6.  
Each of these 10 possible combinations has the probability \(0.5^{10}=0.0977\%\). Since there are 10 such possibilities, we can multiply this by 10 and obtain the probability as 0.977%. The same process was conducted by simulation, and we obtained a probability of 0.972%. We can conclude that the simulated result is close to the calculated probability, although it differs slightly because of the variance in the simulation framework due to the use of randomized functions guided by seed values. Each time a seed value changes, the randomization algorithm produces different outcomes; this is actually a demonstration of the beauty of randomness in mathematics.  
Graphs showing the likelihood of the consumption of services with different probabilities are shown in Figures 7-9 for 100, 1000, and 10,000 incoming service requests, respectively. These graphs show a clear picture of the evolution of the likelihood of the consumption of each service over time.  
We chose service-search latency as a metric to illustrate the performance gain achieved by implementing the proposed method. In this analysis, the load of the system was calculated by obtaining the amount of service consumption requested during a decision epoch (a small finite interval). As illustrated by the comparison graph in Figure 10, this metric was tested with three scenarios: scenario I, in which no context awareness or MLE is applied and implemented (NCA_Non_LH system); scenario II implemented with context awareness but without the concept of MLE (CA_Non_LH system); and finally, scenario III implemented with both context awareness and the MLE (CA_LH system). As described, the design of this system leverages the advantages of spatio-temporal correlations within service consumption patterns. The results show that the proposed method performs better than the existing non-MLE-estimator-based approach as well as the context-aware approach.  
Figure 6: Different possible service consumption variations.  
Figure 8: Plots of average consumption probability for services with different consumption likelihoods over 1000 service consumption requests.  
Figure 7: Plots of average consumption probability for services with different consumption likelihoods over 100 service consumption requests.