# Detection of Transmission State of Multiple Wireless Sources: A Statistical Mechanics Approach
## 5 Results Using the Replica Approach  
In this section, we describe how to obtain the results below using the replica approach, which constitutes the main results of this paper. For reasons of completeness, we analyze the replica method for our problem in Appendix B. For more details concerning the replica method, the interested reader is referred to [51, 52, 53]. We first average over the replicated partition function, i.e., \(\mathbb{E}[\mathcal{Z}^{n}]\) (see (34)), assuming a random graph with a Poisson-distributed source-connectivity probability and SU-connectivity probability \(\mathbb{P}_{k}\), with Poisson parameters \(T\) and \(R\), respectively (see (5)). We also assume that the source-activity probability is \(\mathbb{P}_{\alpha}\) (which, in simulations, we set to \(\mathbb{P}_{\alpha}=0.5\)), which means that each source is on with probability \(\mathbb{P}_{\alpha}\). In addition, we assume a Gaussian noise of strength \(\sigma^{2}\). After taking the replica-symmetry approximation, the fixed-point equations take a form similar to (17) and (24). However, since the \(H\) and \(\widehat{h}\) fields appearing are random, the fixed-point equations amount to the determination of their distributions in a self-consistent manner. Equations (17) and (24) provide the (stochastic) relationship between the effective fields \(H\) and \(\widehat{H}\). As a result, at a steady state on the random graph where these quantities reside, their probability densities need to be related. In particular, by taking the limit of \(\beta\to\infty\), we obtain the following two basic recursive relations for their probability density, following [54]  
\[\widehat{Q}\Big{(}\widehat{H}\Big{)}=\lim_{\beta\to\infty}\mathbb{E}_{\mathbf{ G},\mathbf{z},\mathbf{z}}\left[\prod_{i=1}^{R}\int\mathrm{d}H_{i}\,Q(H_{i}) \delta\Big{(}\widehat{H}-\big{[}e_{\beta}(H)\big{]}\Big{)}\right] \tag{35}\]  
with the expectation being over the realizations of the channel instantiation \(\mathbf{G}\), the noise \(\mathbf{z}\), and the number of SUs per source \(R\) and  
\[Q(H)=\mathbb{E}_{T}\left[\prod_{k=1}^{T-1}\int\mathrm{d}\widehat{H}_{k} \widehat{Q}\Big{(}\widehat{H}_{k}\Big{)}\delta\Bigg{(}H-\sum_{k=1}^{T-1} \widehat{H}_{k}\Bigg{)}\right] \tag{36}\]  
with \(T\) being the (random) number of sources per SU. It has been shown that both \(T\) and \(R\) follow the Poisson distribution determined by the average density of the sources and SUs in the network. The probability of erroneous detection can be derived directly from the above distributions, (36) and (35), as depicted in Figure 3, and it can be written as  
\[\mathbb{P}_{\text{err}}=\frac{1}{2}\Big{(}1-\mathbb{E}_{H,\widehat{H}}\Big{[} \text{sgn}\Big{(}H+\widehat{H}\Big{)}\Big{]}\Big{)} \tag{37}\]  
Equations (35)-(37) and the algorithm behind them, i.e., Algorithm 2, are the main results of this paper. The above error probability can be obtained by using population dynamics to calculate \(Q(H)\) and \(\widehat{Q}(\widehat{H})\), which solve the above distributional equations [22]. Population dynamics can be analyzed by representing the effective field distributions by a large population of \(K\) copies (fields) randomly drawn from these two distributions. \(K\) is sufficiently large so as to provide good resolution in the desired performance measures [51]. As inputs, it requires the resolution \(K\), the maximum number of iterations \(I\), and a specification of the ensemble of the graphical model. The latter is needed for the description of the degree distributions between the sources and SUs and vice versa. The algorithmic procedure is described below. First, we create \(K\) random values for \(H\) and \(K\) random samples for \(\widehat{H}\). Using these samples, we take at random \(t-1\) random samples from the \(\widehat{H}\) bin and store their sum at a random location in the \(H\) bin, where \(t\) is a random number obtained from the Poisson distribution, with the parameter R corresponding to the Erdos-Renyi random graph.