# Adaptive BBU Migration Based on Deep Q-Learning for Cloud Radio Access Network
## 5 Simulation Results
### Median Absolute Deviation (MAD)  
The median absolute deviation (MAD) is a robust statistical variance measure. It is computed as a median of the absolute values of the deviation of the data from its median [45]:  
\[\text{MAD}=\text{median}(|\text{Xi}-\text{median}(\text{X})|) \tag{9}\]  
where X is a collection of observations (e.g., the number of VMs attached to candidate nodes). MAD is less sensitive to outliers than the standard deviation. In cloud BBU, MAD is adopted for choosing nodes whose number of attached VMs varies least in terms of the central tendency. The following is the procedure:  
* Data collection: Gather the number of linked VMs from eligible nodes. * Median calculation: Sort the data and compute the median number of linked VMs. * Deviation computation: Calculate the absolute deviations for each node from the median. * Candidate selection: Choose the node with the smallest deviation, indicating a balanced or typical resource usage. If no node has linked VMs, the algorithm defaults to a first-come-first-serve (FCFS) approach. * **Interquartile Range (IQR)** The interquartile range (IQR) is defined as the difference between the third quartile (Q3) and the first quartile (Q1) of the data [46]:  
\[\text{IQR}=\text{Q3}-\text{Q1} \tag{10}\] \begin{table}
\begin{tabular}{l l l} \hline \hline
**Metric** & **Kalman Filter Model** & **DQN Model** \\ \hline CPU Utilization (\%) & 82.5 & 88.7 \\ \hline Memory Utilization (\%) & 79.2 & 85.6 \\ \hline Energy Consumption (kWh) & 250 & 210 \\ \hline Number of Migrations & 180 & 130 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Comparison between DQN and Kalman filter prediction methods. IQR is widely used to measure the spread of the central 50% of a dataset and is effective in detecting outliers when combined with multiplier thresholds (e.g., 1.5 times the IQR). For node selection, IQR is applied to the number of linked VMs:  
* **Data collection:** Obtain the count of linked VMs across candidate nodes. * **Quantile calculation:** Sort the data, compute Q1 and Q3, and then derive the IQR. \t* 1.5 \(\times\) IQR and an upper threshold Q3 + 1.5 \(\times\) IQR. * **Candidate filtering:** Nodes with VM counts below the lower threshold are classified as underutilized, while those within the threshold are deemed acceptable. Nodes exceeding the upper threshold are considered overutilized and are excluded from selection. * **Selection logic:** Preferentially select the underutilized node with the fewest VMs; if none exist, choose the node with an acceptable load. * **Load Ratio (LR)** The **load ratio** is defined as a normalized metric that compares a node's forecasted load to its capacity or a baseline load expectation. Mathematically, it can be expressed as follows [47]:  
\[\text{Load Ratio}=\frac{\text{Forecasted Load}}{\text{Capacity}} \tag{11}\]  
where the forecasted load is a prediction of predicted workload (e.g., number of VMs connected in) calculated through forecasting and modeled with such techniques as ARIMA, and capacity (or Baseline Load) is a predefined, allowable maximum baseline value representing a reflection of a node's capacity. The load ratio is a normalized mechanism for comparing and estimating a node's comparative utilization, disregarding any variation in its actual capacities. Where a low load ratio reflects a node is underused in relation to its capacity, a high load ratio can mean a node is at, or in danger of exceeding, its ideal level of loading. The implementation of this model for the node selection is applied as follows:  
* **Data collection:** Gather the forecasted load values (e.g., predicted number of linked VMs) and the capacity or baseline load for each candidate node. * **Ratio calculation:** Compute the Load Ratio for each node by dividing its forecasted load by its capacity:
* **Threshold determination:** Define thresholds or criteria to classify nodes based on their Load Ratios.