# On the Efficient Generation ofα-κ-μandα-η-μ White Samples with Applications

Authors: Rausley Adriano Amaral de Souza; Antonio Marcelo Oliveira Ribeiro; Dayan Adionel Guimarães
Journal: International Journal of Antennas and Propagation
 (2015)

---

## Abstract

This paper is concerned with a simple and highly efficient random sequence generator for uncorrelatedα-κ-μ and α-η-μ variates. The algorithm may yield an efficiency of almost 100%, and this high efficiency can be reached for all special cases such as α-μ,  κ-μ,   η-μ, Nakagami-m, Nakagami-q, Weibull, Hoyt, Rayleigh, Rice, Exponential, and the One-Sided Gaussian. This generator is implemented via the rejection technique and allows for arbitrary fading parameters. The goodness-of-fit is measured using the Kolmogorov-Smirnov and Anderson-Darling tests. The maximum likelihood parameter estimation for the κ-μ distribution is proposed and verified against true values of the parameters chosen in the generator. We also provide two important applications for the random sequence generator, the first one dealing with the performance assessment of a digital communication system over the α-κ-μ and α-η-μ fading channels and the second one dealing with the performance assessment of the spectrum sensing with energy detection over special cases of these channels. Theoretical and simulation results are compared, validating again the accuracy of the generators.


---

## Body

## 1. Introduction

In nearly all fields of science, simulation is a strikingly powerful tool widely adopted to help develop a better understanding of some phenomenon under investigation. Particularly in engineering, it is used, for instance, to successfully test equipment, algorithms, and techniques, and, to some extent and whenever applicable, to avoid or minimize time-consuming, costly, and inexhaustible field trials. Wireless communications are no exception and in this challenging, lively, and unkind area, with systems becoming increasingly more complex, both industry and academy engage themselves in developing simulators. Such simulators for wireless communications almost certainly include a block for the fading channel.The fading channel can be described by a number of models. Among them, the general models, namely,α-κ-μ, α-η-μ [1], and some particular cases such as κ-μ [2], η-μ [2], and α-μ [3], have been gaining wide acceptance [4–25]. Their flexibility renders them adaptable to situations in which none of the traditional distributions yield good fit [2, 3]. In addition, their applicability has been recognized in practical and real scenarios. Field measurements carried out in diverse propagation environments have shown that, in many situations, these models better accommodate the statistical variations of the propagated signal [1, Section VII], [2, 7–10, 26]. In this sense, developing and ameliorating methods in order to simulate the α-κ-μ and α-η-μ fading models and their special cases forarbitrary values of their parameters are of paramount importance. One first step in such a direction is to generate uncorrelated samples and then, if required, correlate them.This paper is concerned with the generation of uncorrelated samples ofα-κ-μ and α-η-μ fading models for arbitrary values of their parameters. Two largely applied methods in this case are the inversion method and the rejection method. The former involves the knowledge of the inverse of the cumulative distribution function (cdf) of the variate, which is either not always available or cannot be easily implemented, but, on the other hand, is highly efficient. The latter is general and applies to any variate but can be rather inefficient.A useful method for generating independentκ-μ, η-μ, and α-μ sequences with an arbitrary fading parameter was recently investigated in [27]. The method is reported to achieve an efficiency higher than 80% for η-μ and 87.5% for κ-μ. More interestingly, a transformation was proposed in which, from an α-μ sequence, a new α-μ sequence can be obtained with an almost 100% efficiency.In this paper, we extend the applicability of the approach in [28] to provide an easy-to-implement and highly efficient algorithm that generates α-κ-μ and α-η-μ uncorrelated sequences for arbitrary values of their parameters. A simple transformation is also proposed, in which, from an α-κ-μ or α-η-μ sequence, a new α-κ-μ or α-η-μ sequence can be obtained with an almost 100% efficiency. To the best of the authors' knowledge, the results reported here are new.With the aim of quantifying the performance of the random sequence generators, we compare empirical cdfs to hypothesized ones by carrying out goodness-of-fit Kolmogorov-Smirnov (KS) and Anderson-Darling (AD) tests. We also generate a large number ofκ-μ random variables, as a particular case of the α-κ-μ generator, and perform the maximum likelihood (ML) estimation of the parameters κ and μ. We then verify these estimates against true values of κ and μ defined in the generator. In this context, we use the maximum likelihood technique as its estimators have notable properties, mainly for large sample size [29]. In fact, under regularity conditions, for large sample size ML estimators are consistent and have normal distribution with variance attaining the Cramér-Rao lower bound (CRLB) [29].In order to demonstrate the usefulness of the proposed method, we provide theoretical and simulated bit error rates of a coherent binary phase-shift keying (BPSK) modulation over theα-κ-μ and α-η-μ fading channels. We also provide the performance assessment of the spectrum sensing with energy detection over special cases of these channels, namely, the κ-μ and η-μ channels.The remaining of the paper is organized as follows. Section2 presents the preliminary proposed algorithm and briefly describes the general distributions that are the focus of this paper. Numerical results, including the goodness-of-fit test, and their interpretations are presented in Section 3. In Section 4 a near-100% efficient and definitive algorithm for generating α-κ-μ and α-η-μ variates is discussed in detail. Section 5 verifies the α-κ-μ generator performance by checking ML parameter estimates from κ-μ random samples against true values of the distribution parameters. In Section 6 the average error probability of the BPSK modulation over the α-κ-μ and α-η-μ channels and the performance of the spectrum sensing over the κ-μ and η-μ channels are presented. Some conclusions are drawn in Section 7.


## 2. Proposed Algorithm: Preliminary Results

In this section we present a preliminary proposed algorithm. However, in Section4 the definitive and more efficient algorithm will be presented.The majorizing hat functiong(ρ) used here is given as [30](1)g(ρ)=ch(ρ)=bexp⁡-aρ-ρ02≥fPx-y-z(ρ),where h(ρ) is the majorizing density, a, b, and ρ0 are coefficients to be obtained for the specific fading model so that g(ρ) can majorize fPx-y-z(ρ) for all ρ, and fPx-y-z(ρ) is the desired probability density function (pdf) given in terms of the normalized envelope ρ, with x-y-z standing for α-κ-μ or α-η-μ. The parameter c is given in an exact form as(2)c=b2πa1+erf⁡aρ0,where erf⁡(·) is the error function. The coefficient ρ0 is obtained as the solution of (d/dρ)fPx-y-z(ρ)=0. In all cases, the parameter ρ0 can be easily found numerically using well-known software tools such as Mathematica or MATLAB. The coefficient b is found as the mode of the pdf; that is, b=fPx-y-z(ρ0). Finally, the coefficient a is found as(3)a=min⁡1ρ-ρ02ln⁡fPx-y-z(ρ0)fPx-y-z(ρ).Algorithm 1 summarizes the steps for generating the desired sequences. The probability of acceptance in step 7 is 1/c. U(0,1) is the uniform distribution over the unit interval (0,1]. The rejection method is well known and it is described in detail in [31]. Notice that the function h(ρ) has the form of a truncated-Gaussian density. Random variables with pdf h(ρ) can be generated in a fast and accurate way by truncated-Gaussian random variables generation methods (e.g., [32]).Algorithm 1:Preliminary algorithm.
(1) Define the distribution parameters
(2) Findρ0, solving (d/dρ)fPx-y-z(ρ)=0
(3) Findb=fPx-y-z(ρ0)
(4) Finda=min⁡{(1/(ρ-ρ0)2)ln⁡(fPx-y-z(ρ0)/fPx-y-z(ρ))}, with 0≤ρ<∞
(5) GenerateY from the distribution with density function h(ρ)=bexp⁡[-a(ρ-ρ0)2]/c
(6) GenerateU from a U(0,1) distribution
(7)if  U≤fPx-y-z(Y)/ch(Y)  then
(8)P=Y as the desired sample
(9)else
(10)Return to Step  5
(11)end if


### 2.1. Theα-κ-μ Distribution

For a fading signal with envelopeR and normalized envelope P=R/ERαα, the normalized α-κ-μ envelope pdf is given as [1](4)fPα-κ-μρ=ακ1-μ/21+κ1+μ/2μρα1+μ/2-1exp⁡μκ+ρα+κρα×Iμ-12κ(1+κ)μρα/2,where α>0 is a parameter describing the nonlinearity of the propagation medium, κ>0 is the ratio between the total power of the dominant components and the total power of the scattered waves, μ>0 is related to the number of multipath waves, and Iν(·) is the modified Bessel function of first kind and order ν [33].In particular, the first derivative of theα-κ-μ distribution is given by(5)dfPα-κ-μρdρ=12α2κκ+1μ2κ1/2-μ/2κ+1μ+1/2×ραμ/2+α-2exp⁡⁡μ-κ+κ+1ρα×ακκ+1μ-1Iμ-22ρακκ+1μ2+Iμ2ρακκ+1μ2000+2ρακκ+1μ2ρ-α/2αμ-2κ+1μρα+1-2000×Iμ-12ρακκ+1μ2×ακκ+1μ-1.


### 2.2. Theα-η-μ Distribution

For a fading signal with envelopeR and normalized envelope P=R/ERαα, the α-η-μ normalized envelope pdf is given as [1](6)fPα-η-μρ=αη-11/2-μη+11/2+μπexp⁡1+η2μρα/2ηηΓμ×μ1/2+μρα(1/2+μ)-1Iμ-1/2(η2-1)μρα2η,where η≥0 is the ratio between the in-phase scattered wave and the quadrature scattered wave and Γ(·) is the Euler Gamma function [33].In particular, the first derivative of theα-η-μ distribution is given by(7)dfPα-η-μρdρ=-η+12μρα2ηπα2η2-1μμ+3/2η-11/2-μη+1μ+1/200×ραμ+3/2-2exp⁡⁡-η+12μρα2η×4η3/2Γμ-1×Iμ-3/2ραη2-1μ2η+Iμ+1/2ραη2-1μ2η000+2η2αμ+α-2ρ-ααη2-1μ-2η+1η-1000×Iμ-1/2ραη2-1μ2η.


## 2.1. Theα-κ-μ Distribution

For a fading signal with envelopeR and normalized envelope P=R/ERαα, the normalized α-κ-μ envelope pdf is given as [1](4)fPα-κ-μρ=ακ1-μ/21+κ1+μ/2μρα1+μ/2-1exp⁡μκ+ρα+κρα×Iμ-12κ(1+κ)μρα/2,where α>0 is a parameter describing the nonlinearity of the propagation medium, κ>0 is the ratio between the total power of the dominant components and the total power of the scattered waves, μ>0 is related to the number of multipath waves, and Iν(·) is the modified Bessel function of first kind and order ν [33].In particular, the first derivative of theα-κ-μ distribution is given by(5)dfPα-κ-μρdρ=12α2κκ+1μ2κ1/2-μ/2κ+1μ+1/2×ραμ/2+α-2exp⁡⁡μ-κ+κ+1ρα×ακκ+1μ-1Iμ-22ρακκ+1μ2+Iμ2ρακκ+1μ2000+2ρακκ+1μ2ρ-α/2αμ-2κ+1μρα+1-2000×Iμ-12ρακκ+1μ2×ακκ+1μ-1.


## 2.2. Theα-η-μ Distribution

For a fading signal with envelopeR and normalized envelope P=R/ERαα, the α-η-μ normalized envelope pdf is given as [1](6)fPα-η-μρ=αη-11/2-μη+11/2+μπexp⁡1+η2μρα/2ηηΓμ×μ1/2+μρα(1/2+μ)-1Iμ-1/2(η2-1)μρα2η,where η≥0 is the ratio between the in-phase scattered wave and the quadrature scattered wave and Γ(·) is the Euler Gamma function [33].In particular, the first derivative of theα-η-μ distribution is given by(7)dfPα-η-μρdρ=-η+12μρα2ηπα2η2-1μμ+3/2η-11/2-μη+1μ+1/200×ραμ+3/2-2exp⁡⁡-η+12μρα2η×4η3/2Γμ-1×Iμ-3/2ραη2-1μ2η+Iμ+1/2ραη2-1μ2η000+2η2αμ+α-2ρ-ααη2-1μ-2η+1η-1000×Iμ-1/2ραη2-1μ2η.


## 3. Numerical Results

In Figure1, the empirical pdfs generated by the proposed method using 220 samples are contrasted with the theoretical density for different values of κ, η, μ, and α. In this figure, the solid lines correspond to the theoretical results whereas the symbols correspond to the generated random variates. The excellent agreement between theoretical and simulated results can be noticed.Figure 1
Simulated and theoreticalα-κ-μ and α-η-μ densities.


### 3.1. Efficiency

The acceptance proportion, or efficiency, is the performance measure of the acceptance-rejection method. It is the ratio between the number of samples accepted by the method and the total number of samples generated from the respective hat function (majorizing function). Figures2 and 3 depict the efficiency curves for different values of the pdf parameters using the proposed algorithm. Hereafter, the solid lines correspond to the theoretical results whereas the symbols refer to the simulation results.Figure 2
Rejection method efficiency for theα-κ-μ distribution.Figure 3
Rejection method efficiency for theα-η-μ distribution.The efficiency of the proposed method for theα-κ-μ distribution is shown in Figure 2. Notice that the acceptance proportion decreases with the increasing of the parameter κ. As can be seen, the efficiency is rather small for α below 2 but increases rapidly as α reaches 2. The efficiency increases even further to reach almost 100% for α around 2.2. The well-known Nakagami-m distribution is obtained by setting κ→0 and α=2 in the α-κ-μ distribution in which case μ=m and the efficiency is around 75%, in agreement with [30].The efficiency of the proposed method for theα-η-μ distribution is shown in Figure 3. Notice that the acceptance proportion increases with the increasing of the η parameter for a fixed α>4. The Nakagami-m distribution is obtained by setting α=2, for η→1, in which case μ=m/2, or, equivalently, for η→0, in which case μ=m in the α-η-μ distribution. In this case, once again, the efficiency stays around 75%, in agreement with [30].In all the cases, the acceptance ratio does not vary significantly with the variation ofμ. In both, Figures 2 and 3, the acceptance proportion decreases with the increase of the fading parameter α. This is a purely mathematical problem, in which we want to find a function (hat function) which is as close as possible to the distribution whose samples are to be generated. As it happens, the variations of the parameters provoke a change in the shape of the curves, which depart from that of the hat function, leading to an increase or a decrease in the efficiency. It is noteworthy that the samples are drawn with arbitrary parameters α, κ, η, and μ. Clearly, the acceptance proportion achieved using the proposed majorizing density is higher than when compared with a traditional uniform majorizing density.A strikingly interesting result is shown next. Refer to Figure2 for the efficiency of generating the α-κ-μ random variable. It can be noticed that the efficiency reaches almost 100% for α≅2.2. For instance, with α=2.2, κ=3.5, and μ=4.25 the efficiency is 99.76%. A similar conclusion can be found for the efficiency of generating the α-η-μ random variable plotted in Figure 3. In this case the efficiency reaches almost 100% for α≅3.5.Figure4 depicts the efficiency curves for the α-κ-μ over different values of κ and μ with fixed α=2.2. Notice that the efficiency starts above 85% (κ=0, α-μ case with α=2.2), increases, and decreases but is still above 95% for μ>1.Figure 4
Rejection method efficiency for theα-κ-μ distribution with α=2.2.Figure5 plots the efficiency curves for the α-η-μ over different values of η and μ using α=3.5. Notice that the efficiency starts above 95% (η=1, α-μ case with α=3.5), increases, and decreases but is still above 92.5% for μ>1.Figure 5
Rejection method efficiency for theα-η-μ distribution with α=3.5.


### 3.2.  Goodness-of-Fit Test

The difference between the theoretical and experimental distributions is minimal as visually perceived in Figure1. However, in order to objectively quantify the performance of the random sequence generator for the α-κ-μ and α-η-μ fading distributions, the Kolmogorov-Smirnov (KS) test is performed so that the empirical cdf and the hypothesized cdf are compared. As found in the literature (e.g., [29]), the measure of the fit accuracy is given by the P-value. Table 1 reports P-values obtained for the generated sequences with different values of κ, η, μ, and α. In all of the cases, P>0.05, unveiling an excellent goodness-of-fit test result [31].Table 1
P values of the KS test.
Parameters
P value
α
=
2.25, κ=3.50, μ=1.75
0.8218
α
=
2.25, κ=3.75, μ=2.50
0.6293
α
=
1.50, η=3.25, μ=1.50
0.3654
α
=
1.50, η=2.75, μ=3.25
0.6745It is well known that the Anderson-Darling test gives more weight to the tails than the KS test. Also, because the Anderson-Darling test is specific for the hypothesized distribution, this test is likely to be more powerful than the traditional KS test [31]. For these reasons, we additionally have performed the Anderson-Darling goodness-of-fit test, with the objective of confirming the adherence of the generated random numbers also in the tails of their probability distributions. In general, critical values of the Anderson-Darling test statistic depend on the specific distribution being tested. We have tested two particular cases of the α-κ-μ and α-η-μ distributions, since for these cases the exact critical values and, consequently, the P value are calculated analytically. The test has been performed for Weibull distribution (α-κ-μ with α=3.5, κ=0, and μ=1) and for the exponential distribution (α-κ-μ with α=1, κ=0, and μ=1). In the latter case the P value was 0.8352. In the first one the P value was 0.5236. These values reveal the adherence of the generated random numbers also in the tails of their probability distributions.


## 3.1. Efficiency

The acceptance proportion, or efficiency, is the performance measure of the acceptance-rejection method. It is the ratio between the number of samples accepted by the method and the total number of samples generated from the respective hat function (majorizing function). Figures2 and 3 depict the efficiency curves for different values of the pdf parameters using the proposed algorithm. Hereafter, the solid lines correspond to the theoretical results whereas the symbols refer to the simulation results.Figure 2
Rejection method efficiency for theα-κ-μ distribution.Figure 3
Rejection method efficiency for theα-η-μ distribution.The efficiency of the proposed method for theα-κ-μ distribution is shown in Figure 2. Notice that the acceptance proportion decreases with the increasing of the parameter κ. As can be seen, the efficiency is rather small for α below 2 but increases rapidly as α reaches 2. The efficiency increases even further to reach almost 100% for α around 2.2. The well-known Nakagami-m distribution is obtained by setting κ→0 and α=2 in the α-κ-μ distribution in which case μ=m and the efficiency is around 75%, in agreement with [30].The efficiency of the proposed method for theα-η-μ distribution is shown in Figure 3. Notice that the acceptance proportion increases with the increasing of the η parameter for a fixed α>4. The Nakagami-m distribution is obtained by setting α=2, for η→1, in which case μ=m/2, or, equivalently, for η→0, in which case μ=m in the α-η-μ distribution. In this case, once again, the efficiency stays around 75%, in agreement with [30].In all the cases, the acceptance ratio does not vary significantly with the variation ofμ. In both, Figures 2 and 3, the acceptance proportion decreases with the increase of the fading parameter α. This is a purely mathematical problem, in which we want to find a function (hat function) which is as close as possible to the distribution whose samples are to be generated. As it happens, the variations of the parameters provoke a change in the shape of the curves, which depart from that of the hat function, leading to an increase or a decrease in the efficiency. It is noteworthy that the samples are drawn with arbitrary parameters α, κ, η, and μ. Clearly, the acceptance proportion achieved using the proposed majorizing density is higher than when compared with a traditional uniform majorizing density.A strikingly interesting result is shown next. Refer to Figure2 for the efficiency of generating the α-κ-μ random variable. It can be noticed that the efficiency reaches almost 100% for α≅2.2. For instance, with α=2.2, κ=3.5, and μ=4.25 the efficiency is 99.76%. A similar conclusion can be found for the efficiency of generating the α-η-μ random variable plotted in Figure 3. In this case the efficiency reaches almost 100% for α≅3.5.Figure4 depicts the efficiency curves for the α-κ-μ over different values of κ and μ with fixed α=2.2. Notice that the efficiency starts above 85% (κ=0, α-μ case with α=2.2), increases, and decreases but is still above 95% for μ>1.Figure 4
Rejection method efficiency for theα-κ-μ distribution with α=2.2.Figure5 plots the efficiency curves for the α-η-μ over different values of η and μ using α=3.5. Notice that the efficiency starts above 95% (η=1, α-μ case with α=3.5), increases, and decreases but is still above 92.5% for μ>1.Figure 5
Rejection method efficiency for theα-η-μ distribution with α=3.5.


## 3.2.  Goodness-of-Fit Test

The difference between the theoretical and experimental distributions is minimal as visually perceived in Figure1. However, in order to objectively quantify the performance of the random sequence generator for the α-κ-μ and α-η-μ fading distributions, the Kolmogorov-Smirnov (KS) test is performed so that the empirical cdf and the hypothesized cdf are compared. As found in the literature (e.g., [29]), the measure of the fit accuracy is given by the P-value. Table 1 reports P-values obtained for the generated sequences with different values of κ, η, μ, and α. In all of the cases, P>0.05, unveiling an excellent goodness-of-fit test result [31].Table 1
P values of the KS test.
Parameters
P value
α
=
2.25, κ=3.50, μ=1.75
0.8218
α
=
2.25, κ=3.75, μ=2.50
0.6293
α
=
1.50, η=3.25, μ=1.50
0.3654
α
=
1.50, η=2.75, μ=3.25
0.6745It is well known that the Anderson-Darling test gives more weight to the tails than the KS test. Also, because the Anderson-Darling test is specific for the hypothesized distribution, this test is likely to be more powerful than the traditional KS test [31]. For these reasons, we additionally have performed the Anderson-Darling goodness-of-fit test, with the objective of confirming the adherence of the generated random numbers also in the tails of their probability distributions. In general, critical values of the Anderson-Darling test statistic depend on the specific distribution being tested. We have tested two particular cases of the α-κ-μ and α-η-μ distributions, since for these cases the exact critical values and, consequently, the P value are calculated analytically. The test has been performed for Weibull distribution (α-κ-μ with α=3.5, κ=0, and μ=1) and for the exponential distribution (α-κ-μ with α=1, κ=0, and μ=1). In the latter case the P value was 0.8352. In the first one the P value was 0.5236. These values reveal the adherence of the generated random numbers also in the tails of their probability distributions.


## 4. Main Result: A Near-100% Efficient Algorithm for Generating α-κ-μ, α-η-μ Variates, and Their Particular Cases

A modified procedure for a high-efficient and definitive algorithm can be noticed in this section. Let us consider first theα-κ-μ density. From (12) of [3], it is possible to conclude that in the case of the α-κ-μ distribution, for any set (α1,κ,μ) and (α2,κ,μ), the following holds: Pα1-κ-μα1=Pα2-κ-μα2. That is, given an α-κ-μ distribution with parameters (α1,κ,μ), another α-κ-μ distribution with parameters (α2,κ,μ), can be obtained by following the given transformation. In particular, knowing that an efficiency of almost 100% is achieved for α-κ-μ samples with α=2.2 (see Figure 4), a transformation of the kind Pα-κ-μα=P2.2-κ-μ2.2 can be used to attain any α-κ-μ samples with this high efficiency.Considering theα-η-μ distribution, for any set (α1,η,μ) and (α2,η,μ), the following holds: Pα1-η-μα1=Pα2-η-μα2. That is, given an α-η-μ distribution with parameters (α1,η,μ), another α-η-μ distribution with parameters (α2,η,μ) can be obtained by following the given transformation. Specifically, knowing that an efficiency of almost 100% is achieved for α-η-μ samples with α=3.5 (see Figure 5), a transformation of the kind Pα-η-μα=P3.5-η-μ3.5 can be used to achieve any α-η-μ samples with this high efficiency. In such cases, the efficiency is kept constant and close to 100%, throughout the variation of the parameters.Becauseκ-μ and η-μ are particular cases of the α-κ-μ and α-η-μ distributions (if we set α=2), respectively, notice that for both, κ-μ and η-μ distributions, the same high efficiency can be attained. In other words, in order to generate κ-μ samples with an almost 100% efficiency, the best choice is to generate α-κ-μ samples with α=2.2 and make the transformation P2-κ-μ2=P2.2-κ-μ2.2. For the η-μ case, P2-η-μ2=P3.5-η-μ3.5.In the same way, one can conclude that the high efficiency can be reached for all the particular cases ofα-κ-μ and α-η-μ distributions such as the well-known Nakagami-m, Rayleigh, and Weibull densities. All the particular cases of the α-κ-μ and α-η-μ distributions can be found in [1, Section VI].The steps for generating the desired sequences using the definitive algorithm are summarized in the Algorithm2.Algorithm 2:Definitive algorithm.
(1) Define the distribution parameters
(2) Findρ0, solving (d/dρ)fPx-y-z(ρ)=0
(3) Findb=fPx-y-z(ρ0)
(4) Finda=min⁡{(1/(ρ-ρ0)2)ln⁡(fPx-y-z(ρ0)/fPx-y-z(ρ))}, with 0≤ρ<∞
(5) GenerateY from the distribution with density function h(ρ)=bexp⁡[-a(ρ-ρ0)2]/c
(6) GenerateU from a U(0,1) distribution
(7)if  U≤fPx-y-z(Y)/ch(Y)  then
(8)P=Y as the desired sample
(9)else
(10)Return to Step  5
(11)end if
(12) Make the transformationPα-κ-μα=P2.2-κ-μ2.2 to obtain α-κ-μ samples or
Make the transformation Pα-η-μα=P3.5-η-μ3.5 to obtain α-η-μ samples


## 5.κ-μ Random Variable Generation and Maximum-Likelihood Parameter Estimation

The generator ability in providing random samples following a given distribution can be alternatively verified by generating a large number of random variables and obtaining maximum likelihood (ML) estimates for the distribution parameters. In this section, as a particular case of theα-κ-μ generator, we generated sample data sets of n independent identically distributed (i.i.d.) κ-μ random variables. Then, for each data set, we applied the ML parameter estimation and verified the estimates against true values of the generator parameters.


### 5.1.κ-μ Maximum Likelihood Parameter Estimation

LetP=[P1,P2,…,Pn] be n random variables representing normalized envelope observations P1=ρ1,P2=ρ2,…,Pn=ρn following a common κ-μ distribution. We assume that this sample data set has a joint probability density function given by fP(ρ1,ρ2,…,ρn;θ), where θ=[θ1,θ2]=[κ,μ] is the parameter vector to be estimated. The ML estimator Θ^ML can be determined maximizing the likelihood function fP(ρ1,ρ2,…,ρn;θ) as [29](8)Θ^ML=sup⁡θfP(ρ;θ).In particular, assuming P1,P2,…,Pn as i.i.d. random variables and with [2, Equation (1)], the random samples have a joint pdf given by(9)fPρ;θ=∏i=1n‍2μ1+κμ+1/2κμ-1/2exp⁡⁡κμρiμexp⁡-μ1+κρi2×Iμ-12μκ+κ2ρi.Equivalently, we can maximize the log-likelihood function L(ρ;θ)=ln⁡[fP(ρ;θ)], which follows directly from (9) as(10)Lρ;θ=nln⁡2μ1+κμ+1/2κμ-1/2exp⁡⁡κμ+μ∑i=1n‍ln⁡⁡ρi-μ1+κ∑i=1n‍ρi2+∑i=1n‍ln⁡Iμ-12μκ(1+κ)ρi,to write(11)Θ^ML=sup⁡θL(ρ;θ).From (11), one can see that it is necessary to simultaneously solve the following equations:(12)∂L(ρ;θ)∂θj=0,j=1,2,in order to obtain κ^ML and μ^ML.Taking the derivative of (10) with respect to κ, after some simplifications we have(13)∂Lρ;κ,μ∂κ=n1+μ21+κ+n1-μ2κ-nμ-μ∑i=1n‍ρi2+∑i=1n‍[Iμ-2(y)+Iμ(y)]μ(1+2κ)ρi2Iμ-1(y)κ+κ2,where y=2μκ(1+κ)ρi. In the same way(14)∂Lρ;κ,μ∂μ=n1μ-κ+n2ln⁡1+κκ+∑i=1n‍ln⁡⁡ρi-(1+κ)∑i=1n‍ρi2+∑i=1n‍1Iμ-1(y)∂Iμ-1(y)∂μ.Observe that Iν(z) in (14) depends on μ with respect to both the order ν and the parameter z. Hence, the derivative with respect to μ in the last term of (14) is the sum of two terms, one only related to z and the other only related to ν. As a result, we have(15)∂Iμ-1y∂μ=∂Iνz∂z∂z∂μ+∂Iνz∂ν∂ν∂μ=ρiκ(1+κ)[Iμ-2(y)+Iμ(y)]+Iμ-1(1,0)(y).Here Iν(1,0)(z) is defined as the derivative of Iν(z) with respect to the order ν [33, Equation (9.6.42)]; that is(16)Iν1,0z=∂Iνz∂ν=Iν(z)ln⁡(z2)-z2ν∑k=0∞‍ψ0(ν+k+1)Γ(ν+k+1)(z2/4)kk!,where ψ0(·) is the Digamma function [33, Equation (6.3.1)]. Fortunately, the function defined in (16) is available for direct usage in current numerical softwares, such as Mathematica, for instance, which makes (16) numerically tractable without additional difficulties.In general, it is less computationally intensive to evaluateκ^ML and μ^ML iteratively by optimization algorithms, that is, finding Θ^ML that maximizes L(ρ;θ) according to (11). Here we use the iterative optimization algorithm fmincon(·), available in the MATLAB software, to estimate the distribution parameters. In this case, we maximize the log-likelihood function applying the algorithm over the negative log-likelihood -L(ρ;θ). However, we still make use of (13) and (14) in the estimator variance analysis.The variance of an estimator is a measurement of its ability to perform reliably as it gives the degree of certainty in which the parameter is being estimated. In this context, the Cramér-Rao lower bound (CRLB) sets a lower limit for the variance of all unbiased estimators forθ and gives the asymptotic variance for its ML estimator in a large sample size condition [34]. Particularly, we can obtain the CRLB by evaluating the Fisher information matrix In(θ) contained in n random variables P1,P2,…,Pn about the parameter θ as [35] (17)Inθ=E∂L(ρ;θ)∂κ2∂L(ρ;θ)∂κ∂L(ρ;θ)∂μ∂L(ρ;θ)∂μ∂L(ρ;θ)∂κ∂L(ρ;θ)∂μ2,where E[·], meaning the expectation operator, is taken with respect to the random variable P. One can note that E[·] implies a multiple integration as L(ρ;θ) depends on P1,P2,…,Pn. Fortunately, it has been shown that n i.i.d. random samples, representative of the population fP(ρ1,ρ2,…,ρn;θ), have In(θ)=nI(θ) [35], where I(θ) is the Fisher information contained in only one random variable P about θ. In a matrix form we have [35](18)Inθ=nIθ=nE∂ln⁡fP(ρ;θ)∂κ2∂ln⁡fP(ρ;θ)∂κ∂ln⁡fP(ρ;θ)∂μ∂ln⁡fP(ρ;θ)∂μ∂ln⁡fP(ρ;θ)∂κ∂ln⁡fP(ρ;θ)∂μ2,where the derivatives ∂ln⁡fP(ρ;θ)/∂κ and ∂ln⁡fP(ρ;θ)/∂μ are obtained, respectively, from (13) and (14) by setting n=1. One can readily verify that the derivatives are given by(19)∂ln⁡fPρ;θ∂κ=1+μ21+κ+1-μ2κ-μ1+ρ2+Iμ-2y+Iμyμ1+2κρ2Iμ-1yκ+κ2,(20)∂ln⁡fPρ;θ∂μ=1μ-κ+ln⁡1+κκρ-1+κρ2+ρκ(1+κ)[Iμ-2(y)+Iμ(y)]+Iμ-1(1,0)(y)Iμ-1(y).The element [I(θ)]11, for instance, is numerically solved as(21)Iθ11=∫0∞‍∂ln⁡fP(ρ;θ)∂κ2fP(ρ;θ)dρ,where fP(ρ;θ) is the κ-μ pdf given by [2, Equation (1)]. After numerically evaluating I(θ), the CRLB or, equivalently, the asymptotic covariance matrix of Θ^ML, based on n i.i.d. observations ρi, is given by (1/n)I(θ)-1 [35]. As a consequence, for a large sample size we have Var[κ^ML]→(1/n)I(θ)-111 and Var[μ^ML]→(1/n)I(θ)-122.Figure6 shows the normalized asymptotic variances Var[κ^ML]n=1 and Var[μ^ML]n=1, based on the Fisher information contained in only one observation P=ρ about the parameter θ. In particular, Figure 6(a) shows that Var[κ^ML]n=1 has a minimum value about κ=1 and does not depend on μ from a practical point of view. Note that this variance increases with the value of κ and tends to infinity when κ→0, denoting large uncertainty in estimating the parameter in a population with κ≈0. Similarly, Figure 6(b) depicts that Var[μ^ML]n=1 has no practical dependence with κ and linearly increases with μ.Figure 6
Normalized standard deviation curves for the ML estimators ofκ and μ. (a) Var[κ^ML]n=1 as function of κ and for μ={1,10}. (b) Var[μ^ML]n=1 as function of μ and for κ={1,10}.
(a)
(b)Also, it has been shown [35] that Θ^ML has an asymptotic multivariate Gaussian distribution with mean θ and covariance matrix (1/n)I(θ)-1. Thus, as n→∞(22)Θ^MLi-θi(1/n)Iθ-1ii⟶N(0,1),i=1,2.Furthermore, it is straightforward to find [36] the confidence interval l(ρ),u(ρ) for Θ^ML=[κ^ML,μ^ML], with confidence level of 95%, as(23)Θ^MLi-1.961nIθ-1ii,00Θ^MLi+1.961nIθ-1ii,i=1,2.We note that I(θ) in (23) depends on θ, that is, the true value of the parameter, which is therefore unknown. However, Θ^ML converges in probability to θ as n→∞ [34], which makes it possible to infer that(24)I(Θ^ML)⟶I(θ)as n→∞. As a result, for large sample sizes we can estimate I(θ) by I(Θ^ML) in (23) in order to compute the confidence interval.


### 5.2.  Performance of theκ-μ Random Variable Generator

We use Monte Carlo simulations in order to study the performance of theκ-μ generator. Following the guidelines given in Section II, for each κ in the set {0.25,0.5,0.75,…,4.75,5}, μ=1 and α=2 [1], we generate 500 sequences of n=25000 i.i.d. κ-μ random variables. Similarly, we generate 500 i.i.d. κ-μ sequences of the same length for each μ from the set {0.5,0.75,1,…,4.75,5},  κ=2 and α=2. In this way we cover a useful range of the parameters κ and μ, found in both indoor and outdoor multipath propagation environments [2, 37].Taking advantage of notable properties of the ML estimation for large sample sizes, we calculate ML estimates of the parametersκ and μ for each sequence, according to (11), using the already cited algorithm fmincon(·), available in the MATLAB software. The starting values of the estimates required by the algorithm are given as the true values of the parameters.Figure7 shows the sample mean of κ^ML, (1/500)∑i=1500‍κ^MLi, against the true value of the parameter. In order to show the estimator variations about its sample mean, we also plotted in Figure 7 a confidence region defined by ±2×(sample standard deviation of κ^ML), where the sample standard deviation is given by [(1/500)∑i=1500‍κ^MLi2-((1/500)∑i=1500‍κ^MLi)2]1/2. We verify that, for a large sample size, κ^ML is unbiased, from a practical point of view, for the useful range of κ. This is in accordance with the unbiased behavior that the ML estimators have in large sample size conditions [29]. In addition, the confidence region of κ^ML becomes broader as κ increases; that is, the variance of κ^ML increases with the value of the parameter, as observed from the results in Figure 6(a).Figure 7
Sample mean and confidence region (±2×sample standard deviation) of κ^ML, for n=25000 and μ=1.Similar results of the sample mean forμ^ML against μ are depicted in Figure 8. Likewise, μ^ML is practically unbiased for the useful range of μ and its variance increases with the value of the parameter, according to the results in Figure 6(b).Figure 8
Sample mean and confidence region (±2×sample standard deviation) of μ^ML, for n=25000 and κ=2.The unbiasedness of the ML estimators for large sample sizes, depicted in Figures7 and 8, reveals the κ-μ generator ability to provide real random samples representative of a population with distribution fP(ρ;κ,μ). This also alternatively confirms the excellent goodness-of-fit results given by the Kolmogorov-Smirnov and Anderson-Darling tests in Section 3, when applied to the α-κ-μ generator.


## 5.1.κ-μ Maximum Likelihood Parameter Estimation

LetP=[P1,P2,…,Pn] be n random variables representing normalized envelope observations P1=ρ1,P2=ρ2,…,Pn=ρn following a common κ-μ distribution. We assume that this sample data set has a joint probability density function given by fP(ρ1,ρ2,…,ρn;θ), where θ=[θ1,θ2]=[κ,μ] is the parameter vector to be estimated. The ML estimator Θ^ML can be determined maximizing the likelihood function fP(ρ1,ρ2,…,ρn;θ) as [29](8)Θ^ML=sup⁡θfP(ρ;θ).In particular, assuming P1,P2,…,Pn as i.i.d. random variables and with [2, Equation (1)], the random samples have a joint pdf given by(9)fPρ;θ=∏i=1n‍2μ1+κμ+1/2κμ-1/2exp⁡⁡κμρiμexp⁡-μ1+κρi2×Iμ-12μκ+κ2ρi.Equivalently, we can maximize the log-likelihood function L(ρ;θ)=ln⁡[fP(ρ;θ)], which follows directly from (9) as(10)Lρ;θ=nln⁡2μ1+κμ+1/2κμ-1/2exp⁡⁡κμ+μ∑i=1n‍ln⁡⁡ρi-μ1+κ∑i=1n‍ρi2+∑i=1n‍ln⁡Iμ-12μκ(1+κ)ρi,to write(11)Θ^ML=sup⁡θL(ρ;θ).From (11), one can see that it is necessary to simultaneously solve the following equations:(12)∂L(ρ;θ)∂θj=0,j=1,2,in order to obtain κ^ML and μ^ML.Taking the derivative of (10) with respect to κ, after some simplifications we have(13)∂Lρ;κ,μ∂κ=n1+μ21+κ+n1-μ2κ-nμ-μ∑i=1n‍ρi2+∑i=1n‍[Iμ-2(y)+Iμ(y)]μ(1+2κ)ρi2Iμ-1(y)κ+κ2,where y=2μκ(1+κ)ρi. In the same way(14)∂Lρ;κ,μ∂μ=n1μ-κ+n2ln⁡1+κκ+∑i=1n‍ln⁡⁡ρi-(1+κ)∑i=1n‍ρi2+∑i=1n‍1Iμ-1(y)∂Iμ-1(y)∂μ.Observe that Iν(z) in (14) depends on μ with respect to both the order ν and the parameter z. Hence, the derivative with respect to μ in the last term of (14) is the sum of two terms, one only related to z and the other only related to ν. As a result, we have(15)∂Iμ-1y∂μ=∂Iνz∂z∂z∂μ+∂Iνz∂ν∂ν∂μ=ρiκ(1+κ)[Iμ-2(y)+Iμ(y)]+Iμ-1(1,0)(y).Here Iν(1,0)(z) is defined as the derivative of Iν(z) with respect to the order ν [33, Equation (9.6.42)]; that is(16)Iν1,0z=∂Iνz∂ν=Iν(z)ln⁡(z2)-z2ν∑k=0∞‍ψ0(ν+k+1)Γ(ν+k+1)(z2/4)kk!,where ψ0(·) is the Digamma function [33, Equation (6.3.1)]. Fortunately, the function defined in (16) is available for direct usage in current numerical softwares, such as Mathematica, for instance, which makes (16) numerically tractable without additional difficulties.In general, it is less computationally intensive to evaluateκ^ML and μ^ML iteratively by optimization algorithms, that is, finding Θ^ML that maximizes L(ρ;θ) according to (11). Here we use the iterative optimization algorithm fmincon(·), available in the MATLAB software, to estimate the distribution parameters. In this case, we maximize the log-likelihood function applying the algorithm over the negative log-likelihood -L(ρ;θ). However, we still make use of (13) and (14) in the estimator variance analysis.The variance of an estimator is a measurement of its ability to perform reliably as it gives the degree of certainty in which the parameter is being estimated. In this context, the Cramér-Rao lower bound (CRLB) sets a lower limit for the variance of all unbiased estimators forθ and gives the asymptotic variance for its ML estimator in a large sample size condition [34]. Particularly, we can obtain the CRLB by evaluating the Fisher information matrix In(θ) contained in n random variables P1,P2,…,Pn about the parameter θ as [35] (17)Inθ=E∂L(ρ;θ)∂κ2∂L(ρ;θ)∂κ∂L(ρ;θ)∂μ∂L(ρ;θ)∂μ∂L(ρ;θ)∂κ∂L(ρ;θ)∂μ2,where E[·], meaning the expectation operator, is taken with respect to the random variable P. One can note that E[·] implies a multiple integration as L(ρ;θ) depends on P1,P2,…,Pn. Fortunately, it has been shown that n i.i.d. random samples, representative of the population fP(ρ1,ρ2,…,ρn;θ), have In(θ)=nI(θ) [35], where I(θ) is the Fisher information contained in only one random variable P about θ. In a matrix form we have [35](18)Inθ=nIθ=nE∂ln⁡fP(ρ;θ)∂κ2∂ln⁡fP(ρ;θ)∂κ∂ln⁡fP(ρ;θ)∂μ∂ln⁡fP(ρ;θ)∂μ∂ln⁡fP(ρ;θ)∂κ∂ln⁡fP(ρ;θ)∂μ2,where the derivatives ∂ln⁡fP(ρ;θ)/∂κ and ∂ln⁡fP(ρ;θ)/∂μ are obtained, respectively, from (13) and (14) by setting n=1. One can readily verify that the derivatives are given by(19)∂ln⁡fPρ;θ∂κ=1+μ21+κ+1-μ2κ-μ1+ρ2+Iμ-2y+Iμyμ1+2κρ2Iμ-1yκ+κ2,(20)∂ln⁡fPρ;θ∂μ=1μ-κ+ln⁡1+κκρ-1+κρ2+ρκ(1+κ)[Iμ-2(y)+Iμ(y)]+Iμ-1(1,0)(y)Iμ-1(y).The element [I(θ)]11, for instance, is numerically solved as(21)Iθ11=∫0∞‍∂ln⁡fP(ρ;θ)∂κ2fP(ρ;θ)dρ,where fP(ρ;θ) is the κ-μ pdf given by [2, Equation (1)]. After numerically evaluating I(θ), the CRLB or, equivalently, the asymptotic covariance matrix of Θ^ML, based on n i.i.d. observations ρi, is given by (1/n)I(θ)-1 [35]. As a consequence, for a large sample size we have Var[κ^ML]→(1/n)I(θ)-111 and Var[μ^ML]→(1/n)I(θ)-122.Figure6 shows the normalized asymptotic variances Var[κ^ML]n=1 and Var[μ^ML]n=1, based on the Fisher information contained in only one observation P=ρ about the parameter θ. In particular, Figure 6(a) shows that Var[κ^ML]n=1 has a minimum value about κ=1 and does not depend on μ from a practical point of view. Note that this variance increases with the value of κ and tends to infinity when κ→0, denoting large uncertainty in estimating the parameter in a population with κ≈0. Similarly, Figure 6(b) depicts that Var[μ^ML]n=1 has no practical dependence with κ and linearly increases with μ.Figure 6
Normalized standard deviation curves for the ML estimators ofκ and μ. (a) Var[κ^ML]n=1 as function of κ and for μ={1,10}. (b) Var[μ^ML]n=1 as function of μ and for κ={1,10}.
(a)
(b)Also, it has been shown [35] that Θ^ML has an asymptotic multivariate Gaussian distribution with mean θ and covariance matrix (1/n)I(θ)-1. Thus, as n→∞(22)Θ^MLi-θi(1/n)Iθ-1ii⟶N(0,1),i=1,2.Furthermore, it is straightforward to find [36] the confidence interval l(ρ),u(ρ) for Θ^ML=[κ^ML,μ^ML], with confidence level of 95%, as(23)Θ^MLi-1.961nIθ-1ii,00Θ^MLi+1.961nIθ-1ii,i=1,2.We note that I(θ) in (23) depends on θ, that is, the true value of the parameter, which is therefore unknown. However, Θ^ML converges in probability to θ as n→∞ [34], which makes it possible to infer that(24)I(Θ^ML)⟶I(θ)as n→∞. As a result, for large sample sizes we can estimate I(θ) by I(Θ^ML) in (23) in order to compute the confidence interval.


## 5.2.  Performance of theκ-μ Random Variable Generator

We use Monte Carlo simulations in order to study the performance of theκ-μ generator. Following the guidelines given in Section II, for each κ in the set {0.25,0.5,0.75,…,4.75,5}, μ=1 and α=2 [1], we generate 500 sequences of n=25000 i.i.d. κ-μ random variables. Similarly, we generate 500 i.i.d. κ-μ sequences of the same length for each μ from the set {0.5,0.75,1,…,4.75,5},  κ=2 and α=2. In this way we cover a useful range of the parameters κ and μ, found in both indoor and outdoor multipath propagation environments [2, 37].Taking advantage of notable properties of the ML estimation for large sample sizes, we calculate ML estimates of the parametersκ and μ for each sequence, according to (11), using the already cited algorithm fmincon(·), available in the MATLAB software. The starting values of the estimates required by the algorithm are given as the true values of the parameters.Figure7 shows the sample mean of κ^ML, (1/500)∑i=1500‍κ^MLi, against the true value of the parameter. In order to show the estimator variations about its sample mean, we also plotted in Figure 7 a confidence region defined by ±2×(sample standard deviation of κ^ML), where the sample standard deviation is given by [(1/500)∑i=1500‍κ^MLi2-((1/500)∑i=1500‍κ^MLi)2]1/2. We verify that, for a large sample size, κ^ML is unbiased, from a practical point of view, for the useful range of κ. This is in accordance with the unbiased behavior that the ML estimators have in large sample size conditions [29]. In addition, the confidence region of κ^ML becomes broader as κ increases; that is, the variance of κ^ML increases with the value of the parameter, as observed from the results in Figure 6(a).Figure 7
Sample mean and confidence region (±2×sample standard deviation) of κ^ML, for n=25000 and μ=1.Similar results of the sample mean forμ^ML against μ are depicted in Figure 8. Likewise, μ^ML is practically unbiased for the useful range of μ and its variance increases with the value of the parameter, according to the results in Figure 6(b).Figure 8
Sample mean and confidence region (±2×sample standard deviation) of μ^ML, for n=25000 and κ=2.The unbiasedness of the ML estimators for large sample sizes, depicted in Figures7 and 8, reveals the κ-μ generator ability to provide real random samples representative of a population with distribution fP(ρ;κ,μ). This also alternatively confirms the excellent goodness-of-fit results given by the Kolmogorov-Smirnov and Anderson-Darling tests in Section 3, when applied to the α-κ-μ generator.


## 6. Applications

In this section we give applications of the proposed random variable generators and use theoretical and simulation results for certifying the accuracy of these generators.


### 6.1. Average Error Probability of the BPSK Modulation over theα-κ-μ and α-η-μ Fading Channels

Here we analyze the bit error rate (BER) of the BPSK modulation over frequency-flat fading channels modeled by theα-κ-μ and α-η-μ distributions. We assume coherent detection with matched filter or correlator receivers, for which the following vector channel model applies: the decision variable is y=ρd+v, where ρ is the multiplicative fading with E[P2]=1,  d=+1 represents a bit 1,  d=-1 represents a bit 0, and v is the zero mean, additive white Gaussian noise (AWGN) with variance N0/2.One possible analytical method employed for determining the performance of a mobile radio communication system is by evaluating the error probability as a function of a fixed signal-to-noise ratio (SNR) and then averaging the result over the probability density function of the SNR variations, which is governed by the particular envelope fading distribution. For instance, the bit error probability of the BPSK modulation over the pure AWGN channel as a function of the received SNRγ is given by(25)Pe(γ)=12erfc⁡γ,where γ=ρ2Eb/N0 is the SNR for a particular value of the envelope ρ, Eb/N0 is the ratio between the average energy per bit and the noise power spectral density, and erfc⁡(·) is the complementary error function.Now, we must averagePe(γ) over the probability density function of γ; that is,(26)Pe=∫0∞‍PBPSKfΓx-y-z(γ)dγ,where fΓx-y-z(γ) is the pdf of γ for all γ≥0, with x-y-z standing for α-κ-μ or α-η-μ.Applying a transformation of random variables, from (4) and (6), we have(27)fΓα-κ-μγ=ακ(1-μ)/2(1+κ)(1+μ)/2μγ/γ¯α1+μ/2-12γγ¯exp⁡μκ+γ/γ¯α+κγ/γ¯α×Iμ-12κ(1+κ)μγγ¯α/2(28)fΓα-η-μγ=α(η-1)1/2-μ(η+1)1/2+μπμ1/2+μ2γγ¯exp⁡(1+η)2μγ/γ¯α/2ηηΓμ×γγ¯α1/2+μ-1Iμ-1/2η2-1μγ/γ¯α2η,where γ¯=E(Rα)Eb/N0 is the average SNR when R is α-κ-μ or α-η-μ distributed.The integral in (26) was evaluated numerically. The average error probabilities curves for the α-κ-μ and α-η-μ fading channels are presented in Figures 9 and 10. In these figures, the theoretical results (solid), from (26), and the simulated results (symbols), from a MATLAB program based on the vector channel model presented above, are plotted for the indicated fading conditions. It is clearly observed that, in spite of the variety of the fading conditions, excellent agreement between the estimated and theoretical results is shown, once more certifying the proposed algorithms for random variable generation. A myriad of different scenarios can be exercised for different values of the fading parameters. We omitted some particular cases (e.g., Rice or Nakagami-q) for the sake of brevity. All the particular cases departing from the general models considered in this paper are in agreement with the particular cases presented in the literature (see, for example, the expressions presented in [38]).Figure 9
Average error probability for BPSK withα-κ-μ fading.Figure 10
Average error probability for BPSK withα-η-μ fading.It is worth mentioning that the application just described can be used to check the adherence of the generated random numbers to the tails of their probability distributions as follows. The agreement between theoretical and simulation results in the highEb/N0 regime is an evidence of a good adherence in the tail region, since this region governs the performance at high signal-to-noise levels.


### 6.2.  Spectrum Sensing over theη-μ and κ-μ Fading Channels

Modern wireless communication systems are now facing a huge obstacle, spectrum scarcity. New services and applications appear every day, demanding increased bandwidth, new spectrum bands, or both. However, the currently adopted fixed spectrum allocation policy prevents those services and applications to be deployed in adequate pace. Nevertheless, recent studies have demonstrated that, in fact, the radio-frequency spectrum is quite underutilized in some areas and during some time [39]. The cognitive radio (CR) [40] concept then came into scene, aiming at, among other things, opportunistic dynamic spectrum access to idle bands. In this situation, the network which owns the right of using the spectrum is called the primary network, and the cognitive radio network is usually referred to as the secondary network.To detect the idle bands, also called spectral holes or whitespaces, the CRs must have some sort ofspectrum sensing capability [41]. Among the spectrum sensing techniques already developed, energy detection is one of the most attractive, since it has low implementation complexity and good detection power. In energy detection, a test statistic computed from the received signal energy and the noise variance is compared against a threshold so that the decision upon the occupation of the sensed channel is made.Several studies consider the problem of spectrum sensing with energy detection over the pure AWGN channel, an approach, that is, by far unrealistic since typical wireless communication channels are also subjected to fading. Then, it is of paramount importance to access the performance of a spectrum sensing technique taking into account the channel fading.There are several fading channel models available in the literature. Among them, two well-accepted models deserve attention due to their ability for accurately modelling several real channel conditions in practice. They are theη-μ [2] and κ-μ [2] fading channel models. Both are special cases of the α-η-μ and α-κ-μ fading models considered in this paper, if α=2 is adopted.In this section we applyα-η-μ and α-κ-μ random variates, specialized to η-μ and κ-μ variates, to analyze the performance of the energy detection over fading channels.


#### 6.2.1. System Model

The discrete-time model for the hypothesis test associated with the spectrum sensing problem is given by(29)ri=zi:H0hxi+zi:H1,where H0 denotes an idle channel state and H1 denotes a busy channel, ri is the ith received signal sample collected by the CR, i=1,…,n during the sensing interval, zi is the zero mean Gaussian thermal noise sample generated at the receiver input, xi is the primary transmitted signal sample, and h represents the channel fading envelope, which is assumed to be constant during the sensing interval. From the received signal, the test statistic for the energy detector is computed according to(30)y=1σ2∑i=1n‍ri2,where σ2=N0W is the thermal noise variance measured in the bandwidth W, with N0 being the noise power spectral density. The number of samples n relates with the sensing time T and the bandwidth W through the time-bandwidth product u=TW, leading to n=2TW.The average signal-to-noise ratio (SNR) is defined byγ¯=E[h2](Ex/N0), where the primary transmitted signal energy during the sensing interval is Ex=(1/2W)∑i=1n‍xi2 and Eh2 is the second moment of the fading envelope. Assuming E[h2]=1 without loss of generality and using N0=σ2/W, the average SNR is simplified to γ¯=(1/2σ2)∑i=1n‍xi2. If the primary signal power is Px=Ex/T=(1/n)∑i=1n‍xi2, the noise variance can be determined from a given SNR by applying(31)σ2=nPx2γ¯.


#### 6.2.2. Results

The performance of a spectrum sensing technique is often measured in terms of the probability of detection,Pd, and the probability of false alarm, Pfa. When the primary network signal is present in the sensed channel, Pd is the probability of declaring it indeed present. When the primary network signal is absent, Pfa is the probability of declaring it present. A large value of Pd translates into a small probability of interference from the secondary in the primary network. A small value of Pfa translates into an increased throughput of the secondary network due to a more efficient use of spectral holes. These probabilities are often traded in a receiver operating characteristic (ROC) curve, which shows the values of Pfa versus Pd as the decision threshold is varied.Figure11 shows analytical (lines) and simulation (symbols) results of the energy detection over the η-μ (α-η-μ with α=2) and κ-μ (α-κ-μ with α=2) fading channels. We have considered n=50 samples (TW=u=25), γ¯=3, 5, 8, and 10 dB. The simulation results were obtained from 100,000 Monte Carlo runs. The analytical results were obtained by numerically evaluating (6) and (11) of [42] in the case of η-μ, and by evaluating (3) and (14) of [43] in the case of κ-μ. We have used the Mathematica software package to solve the above equations. The minimum and maximum values of the decision threshold (resp., λmin⁡ and λmax⁡) are also reported to facilitate the reproduction of our results. Specifically, for η=0.1 and μ=1, λmin⁡=31, and λmax⁡=100, for κ=1.5 and μ=0.8, λmin⁡=30, and λmax⁡=85, for η=2 and μ=4, λmin⁡=33, and λmax⁡=86, and for κ=2 and μ=2, λmin⁡=27, and λmax⁡=80.Figure 11
ROC curves forκ-μ and η-μ with different values of κ, η, and μ.From Figure11 the adherence between simulation and analytical results is apparent, validating, again, our random sequence generator.


## 6.1. Average Error Probability of the BPSK Modulation over theα-κ-μ and α-η-μ Fading Channels

Here we analyze the bit error rate (BER) of the BPSK modulation over frequency-flat fading channels modeled by theα-κ-μ and α-η-μ distributions. We assume coherent detection with matched filter or correlator receivers, for which the following vector channel model applies: the decision variable is y=ρd+v, where ρ is the multiplicative fading with E[P2]=1,  d=+1 represents a bit 1,  d=-1 represents a bit 0, and v is the zero mean, additive white Gaussian noise (AWGN) with variance N0/2.One possible analytical method employed for determining the performance of a mobile radio communication system is by evaluating the error probability as a function of a fixed signal-to-noise ratio (SNR) and then averaging the result over the probability density function of the SNR variations, which is governed by the particular envelope fading distribution. For instance, the bit error probability of the BPSK modulation over the pure AWGN channel as a function of the received SNRγ is given by(25)Pe(γ)=12erfc⁡γ,where γ=ρ2Eb/N0 is the SNR for a particular value of the envelope ρ, Eb/N0 is the ratio between the average energy per bit and the noise power spectral density, and erfc⁡(·) is the complementary error function.Now, we must averagePe(γ) over the probability density function of γ; that is,(26)Pe=∫0∞‍PBPSKfΓx-y-z(γ)dγ,where fΓx-y-z(γ) is the pdf of γ for all γ≥0, with x-y-z standing for α-κ-μ or α-η-μ.Applying a transformation of random variables, from (4) and (6), we have(27)fΓα-κ-μγ=ακ(1-μ)/2(1+κ)(1+μ)/2μγ/γ¯α1+μ/2-12γγ¯exp⁡μκ+γ/γ¯α+κγ/γ¯α×Iμ-12κ(1+κ)μγγ¯α/2(28)fΓα-η-μγ=α(η-1)1/2-μ(η+1)1/2+μπμ1/2+μ2γγ¯exp⁡(1+η)2μγ/γ¯α/2ηηΓμ×γγ¯α1/2+μ-1Iμ-1/2η2-1μγ/γ¯α2η,where γ¯=E(Rα)Eb/N0 is the average SNR when R is α-κ-μ or α-η-μ distributed.The integral in (26) was evaluated numerically. The average error probabilities curves for the α-κ-μ and α-η-μ fading channels are presented in Figures 9 and 10. In these figures, the theoretical results (solid), from (26), and the simulated results (symbols), from a MATLAB program based on the vector channel model presented above, are plotted for the indicated fading conditions. It is clearly observed that, in spite of the variety of the fading conditions, excellent agreement between the estimated and theoretical results is shown, once more certifying the proposed algorithms for random variable generation. A myriad of different scenarios can be exercised for different values of the fading parameters. We omitted some particular cases (e.g., Rice or Nakagami-q) for the sake of brevity. All the particular cases departing from the general models considered in this paper are in agreement with the particular cases presented in the literature (see, for example, the expressions presented in [38]).Figure 9
Average error probability for BPSK withα-κ-μ fading.Figure 10
Average error probability for BPSK withα-η-μ fading.It is worth mentioning that the application just described can be used to check the adherence of the generated random numbers to the tails of their probability distributions as follows. The agreement between theoretical and simulation results in the highEb/N0 regime is an evidence of a good adherence in the tail region, since this region governs the performance at high signal-to-noise levels.


## 6.2.  Spectrum Sensing over theη-μ and κ-μ Fading Channels

Modern wireless communication systems are now facing a huge obstacle, spectrum scarcity. New services and applications appear every day, demanding increased bandwidth, new spectrum bands, or both. However, the currently adopted fixed spectrum allocation policy prevents those services and applications to be deployed in adequate pace. Nevertheless, recent studies have demonstrated that, in fact, the radio-frequency spectrum is quite underutilized in some areas and during some time [39]. The cognitive radio (CR) [40] concept then came into scene, aiming at, among other things, opportunistic dynamic spectrum access to idle bands. In this situation, the network which owns the right of using the spectrum is called the primary network, and the cognitive radio network is usually referred to as the secondary network.To detect the idle bands, also called spectral holes or whitespaces, the CRs must have some sort ofspectrum sensing capability [41]. Among the spectrum sensing techniques already developed, energy detection is one of the most attractive, since it has low implementation complexity and good detection power. In energy detection, a test statistic computed from the received signal energy and the noise variance is compared against a threshold so that the decision upon the occupation of the sensed channel is made.Several studies consider the problem of spectrum sensing with energy detection over the pure AWGN channel, an approach, that is, by far unrealistic since typical wireless communication channels are also subjected to fading. Then, it is of paramount importance to access the performance of a spectrum sensing technique taking into account the channel fading.There are several fading channel models available in the literature. Among them, two well-accepted models deserve attention due to their ability for accurately modelling several real channel conditions in practice. They are theη-μ [2] and κ-μ [2] fading channel models. Both are special cases of the α-η-μ and α-κ-μ fading models considered in this paper, if α=2 is adopted.In this section we applyα-η-μ and α-κ-μ random variates, specialized to η-μ and κ-μ variates, to analyze the performance of the energy detection over fading channels.


### 6.2.1. System Model

The discrete-time model for the hypothesis test associated with the spectrum sensing problem is given by(29)ri=zi:H0hxi+zi:H1,where H0 denotes an idle channel state and H1 denotes a busy channel, ri is the ith received signal sample collected by the CR, i=1,…,n during the sensing interval, zi is the zero mean Gaussian thermal noise sample generated at the receiver input, xi is the primary transmitted signal sample, and h represents the channel fading envelope, which is assumed to be constant during the sensing interval. From the received signal, the test statistic for the energy detector is computed according to(30)y=1σ2∑i=1n‍ri2,where σ2=N0W is the thermal noise variance measured in the bandwidth W, with N0 being the noise power spectral density. The number of samples n relates with the sensing time T and the bandwidth W through the time-bandwidth product u=TW, leading to n=2TW.The average signal-to-noise ratio (SNR) is defined byγ¯=E[h2](Ex/N0), where the primary transmitted signal energy during the sensing interval is Ex=(1/2W)∑i=1n‍xi2 and Eh2 is the second moment of the fading envelope. Assuming E[h2]=1 without loss of generality and using N0=σ2/W, the average SNR is simplified to γ¯=(1/2σ2)∑i=1n‍xi2. If the primary signal power is Px=Ex/T=(1/n)∑i=1n‍xi2, the noise variance can be determined from a given SNR by applying(31)σ2=nPx2γ¯.


### 6.2.2. Results

The performance of a spectrum sensing technique is often measured in terms of the probability of detection,Pd, and the probability of false alarm, Pfa. When the primary network signal is present in the sensed channel, Pd is the probability of declaring it indeed present. When the primary network signal is absent, Pfa is the probability of declaring it present. A large value of Pd translates into a small probability of interference from the secondary in the primary network. A small value of Pfa translates into an increased throughput of the secondary network due to a more efficient use of spectral holes. These probabilities are often traded in a receiver operating characteristic (ROC) curve, which shows the values of Pfa versus Pd as the decision threshold is varied.Figure11 shows analytical (lines) and simulation (symbols) results of the energy detection over the η-μ (α-η-μ with α=2) and κ-μ (α-κ-μ with α=2) fading channels. We have considered n=50 samples (TW=u=25), γ¯=3, 5, 8, and 10 dB. The simulation results were obtained from 100,000 Monte Carlo runs. The analytical results were obtained by numerically evaluating (6) and (11) of [42] in the case of η-μ, and by evaluating (3) and (14) of [43] in the case of κ-μ. We have used the Mathematica software package to solve the above equations. The minimum and maximum values of the decision threshold (resp., λmin⁡ and λmax⁡) are also reported to facilitate the reproduction of our results. Specifically, for η=0.1 and μ=1, λmin⁡=31, and λmax⁡=100, for κ=1.5 and μ=0.8, λmin⁡=30, and λmax⁡=85, for η=2 and μ=4, λmin⁡=33, and λmax⁡=86, and for κ=2 and μ=2, λmin⁡=27, and λmax⁡=80.Figure 11
ROC curves forκ-μ and η-μ with different values of κ, η, and μ.From Figure11 the adherence between simulation and analytical results is apparent, validating, again, our random sequence generator.


## 6.2.1. System Model

The discrete-time model for the hypothesis test associated with the spectrum sensing problem is given by(29)ri=zi:H0hxi+zi:H1,where H0 denotes an idle channel state and H1 denotes a busy channel, ri is the ith received signal sample collected by the CR, i=1,…,n during the sensing interval, zi is the zero mean Gaussian thermal noise sample generated at the receiver input, xi is the primary transmitted signal sample, and h represents the channel fading envelope, which is assumed to be constant during the sensing interval. From the received signal, the test statistic for the energy detector is computed according to(30)y=1σ2∑i=1n‍ri2,where σ2=N0W is the thermal noise variance measured in the bandwidth W, with N0 being the noise power spectral density. The number of samples n relates with the sensing time T and the bandwidth W through the time-bandwidth product u=TW, leading to n=2TW.The average signal-to-noise ratio (SNR) is defined byγ¯=E[h2](Ex/N0), where the primary transmitted signal energy during the sensing interval is Ex=(1/2W)∑i=1n‍xi2 and Eh2 is the second moment of the fading envelope. Assuming E[h2]=1 without loss of generality and using N0=σ2/W, the average SNR is simplified to γ¯=(1/2σ2)∑i=1n‍xi2. If the primary signal power is Px=Ex/T=(1/n)∑i=1n‍xi2, the noise variance can be determined from a given SNR by applying(31)σ2=nPx2γ¯.


## 6.2.2. Results

The performance of a spectrum sensing technique is often measured in terms of the probability of detection,Pd, and the probability of false alarm, Pfa. When the primary network signal is present in the sensed channel, Pd is the probability of declaring it indeed present. When the primary network signal is absent, Pfa is the probability of declaring it present. A large value of Pd translates into a small probability of interference from the secondary in the primary network. A small value of Pfa translates into an increased throughput of the secondary network due to a more efficient use of spectral holes. These probabilities are often traded in a receiver operating characteristic (ROC) curve, which shows the values of Pfa versus Pd as the decision threshold is varied.Figure11 shows analytical (lines) and simulation (symbols) results of the energy detection over the η-μ (α-η-μ with α=2) and κ-μ (α-κ-μ with α=2) fading channels. We have considered n=50 samples (TW=u=25), γ¯=3, 5, 8, and 10 dB. The simulation results were obtained from 100,000 Monte Carlo runs. The analytical results were obtained by numerically evaluating (6) and (11) of [42] in the case of η-μ, and by evaluating (3) and (14) of [43] in the case of κ-μ. We have used the Mathematica software package to solve the above equations. The minimum and maximum values of the decision threshold (resp., λmin⁡ and λmax⁡) are also reported to facilitate the reproduction of our results. Specifically, for η=0.1 and μ=1, λmin⁡=31, and λmax⁡=100, for κ=1.5 and μ=0.8, λmin⁡=30, and λmax⁡=85, for η=2 and μ=4, λmin⁡=33, and λmax⁡=86, and for κ=2 and μ=2, λmin⁡=27, and λmax⁡=80.Figure 11
ROC curves forκ-μ and η-μ with different values of κ, η, and μ.From Figure11 the adherence between simulation and analytical results is apparent, validating, again, our random sequence generator.


## 7. Conclusions

In this paper, sequences of general distributionsα-κ-μ and α-η-μ with arbitrary fading parameters were generated using the well-known acceptance-rejection method. Since these densities are general distributions that include a wide range of other distributions, the method is useful for the generation of random numbers of many distinct distributions. The acceptance proportion (more than 95% in some cases) combined with the Kolmogorov-Smirnov and Anderson-Darling tests demonstrate the efficiency and accuracy of the proposed method. The algorithm has been validated by reducing the general case proposed here to special cases already found in the literature. The maximum likelihood parameter estimation was applied to generated κ-μ random samples. The unbiasedness of the κ-μ ML estimators, for large sample size, reveals the generator ability to provide real random samples representative of a population with distribution fP(ρ;κ,μ). Two applications showed the use of the proposed generators to assess the performance of a digital communication system over the α-κ-μ and α-η-μ fading channels and to assess the performance of the spectrum sensing with energy detection over the κ-μ and η-μ fading channels.



---

*Source: 873890-2015-03-22.xml*