## 3 Cognitive Radio Engine Platform Usage Scenario
### Occupancy Probability Calculation in the Learning Engine  
During the execution of the learning engine, the PU occupancy probability with respect to each observed channel can be calculated by counting the time slots for which PU is in the ON state over the entire observation time \(T\). It can also be expressed as the exact theoretical formula shown in Equation (5) [18]:  
\[P_{on}^{n}=\frac{\lambda_{\beta}^{n}}{\lambda_{\alpha}^{n}+\lambda_{\beta}^{n}}\,. \tag{5}\]  
Using the approach for calculating PU occupancy probability making use of empirical observations instead of Equation (5), it is necessary to employ a sampling method for the acquisition of the PU's channel usage patterns with a high degree of accuracy. In this regard, this study applied uniform sampling and weighted sampling methods. The uniform sampling method initially divides the overall time interval \(T\) into individual unit time slots with a uniform size and estimates the PU channel occupancy probability from the samples associated with PU traffic. Furthermore, the calculation methods of uniform sampling for PU channel occupancy probability can be divided into systematic count-based sampling (CB) and random count-based sampling (RB), which are distinguishable according to the size of the sampling interval, which is defined as the individual unit time slot [19; 20]. Figure 7 depicts the process for uniform sampling for a case in which the mean value of the \"OFF\" and \"ON\" intervals is one.  
As in Figure 7, the CB method involves acquiring samples at consistently fixed time slots over every sampling interval. On the other hand, the RB method specifies the time slot to be sampled at random over each sampling interval. Consequently, the PU occupancy probability can be calculated by observing the samples that contain the state of the PU traffic. Equation (6) calculates the occupancy probability of the \(n\)th channel using observed samples obtained by the CB sampling method. Equation (6) can also be applied to the RB sampling method.  
\[P_{CB}^{n}=\frac{1}{M}\sum_{m=1}^{M}S_{n}\left(m\right). \tag{6}\]  
Figure 7: Uniform sampling technique concept and process for the CB and RB methods.  
In Equation (6), \(M\) indicates the overall number of samples, and \(S_{n}(t)\) represents the status of the PU activity indicator so that zero reads as the ON state and one reads as the OFF state at the \(m\)th time slot for channel \(n\). In this paper, besides the conventional systematic and random count-based sampling methods, their weighted versions are proposed namely as WCB and WRB respectively. More precisely, by applying these approaches, the PU occupancy probability can be estimated by considering the temporal correlation. Therefore, relatively high-valued weights are assigned for recently-acquired samples, whereas older samples are weighted by small values. In this case, the weight can be interpreted by the well-known forgetting factor, and the corresponding weighting process primarily tapers the samples observed during the application of the CB and RB methods. Equation (7) corresponds to the estimated PU occupancy probability via the WCB sampling method [20].  
\[P_{WCB}^{m}=\sum_{m=1}^{M}w_{m}S_{n}(m)\,, \tag{7}\]  
\[w_{m}=\frac{1}{K}e^{m},K=\sum_{m=1}^{M}e^{m}\,. \tag{8}\]  
With the assistance of Equation (8), the greatest weight is multiplied by the most recent sample indexed by \(M\), and the lowest value is multiplied by the oldest sample. Furthermore, \(K\) in Equation (8) is the normalization factor and is equivalent to the sum of the exponential values. Similar to Equations (7) and (8), WRB-based PU occupancy probability calculations can be performed on randomly-chosen samples. Table 2 summarizes the features of uniform sampling and weighted sampling.