# Scale-Free Features in Collective Robot Foraging
## 2 Methods
### Data Analysis
#### 2.4.2 Quality Ratio \(\rho_{q}\)  
Given a high quantity of empiric data sets, it is useful to find an automated way for the evaluation of the power law fits. For the analysis of our experiments, we introduce a quality ratio \(\rho_{q}\) which we use as a practical estimate of the plausibility of a (truncated) power law fit based on the well-known rigorous statistical tests described above. The quality ratio \(\rho_{q}\) includes the three criteria discussed in Section 2.4.1: \(p\)-value, \(N_{data,pl}\) and the number of likelihood-ratio tests resulting in \(R>0\). We account for these criteria by defining \(\rho_{q}\) as the product of \(\rho_{q,p}\), \(\rho_{q,data}\) and \(\rho_{q,lrt}\):  
1. First, we begin with the \(p\)-value. As mentioned above, the linear shape of the data distribution on a log-log plot can be mainly attributed to random fluctuations if \(p<0.1\). Taking this into account, we design \(\rho_{q}\) to be a binary piecewise function evaluating the _goodness-of-fit_ in terms of the \(p\)-value: \[\rho_{q,p}= \begin{cases}1.0,&\text{if }p\leq 0.1\\ 0.0,&\text{otherwise.}\end{cases} \] (5) This way, we take into account the possibility that random fluctuations may be present but as soon as \(p>0.1\) we do not assign the precise value of \(p\) to the ranking of the fit. The reason is that random fluctuations might be present even if the data is in fact power law distributed. In that case the \(p\)-value could be very low even if the data is in fact power law distributed. In general, it might be more substantial to consider the size of the fitted data set and to compare the power law fit to other important distributions [54; 56]. 2. Second, \(\rho_{q,data}\), denotes the ratio of the data which is fit by the (truncated) power law \(N_{data,pl}\) to the total number of data points \(N_{data,tot}\). \[\rho_{q,data}=\frac{N_{data,pl}}{N_{data,tot}},\] (6)
3. Third, \(\rho_{q,lrt}\) represents the fraction of likelihood-ratio-tests in which the (truncated) power law fit proved to be statistically more plausible than other distributions. To include the quality of the (truncated) power law fit as compared to other distributions, we count how many times \(n_{lrt,pl}\) we obtained \(R>0\) from the likelihood-ratio tests. We compare the power law fit to _six_ distributions: _truncated power law, exponential, stretched exponential, lognormal, positive lognormal_ and _normal_; all of them are implemented in [56] (except the normal distribution). Hence, we use the piecewise function, \[\rho_{q,lrt}= \begin{cases}0,&\text{if at least one likelihood-ratio test yields }R<0\\ \frac{n_{lrt,pl}+1}{7},&\text{otherwise.}\end{cases} \] (7) where we added \(1\) to \(n_{lrt,pl}\) to account for the possibility that the likelihood-ratio test yields \(R\approx 0\), in which case the support for the power law fit is neither strengthened nor weakened. Please note that in Equation (7) we set \(\rho_{q,lrt}=0\) if at least one distribution is a more reliable model than the power law. However, it is important to remember that our simulated systems are meant to include real-world attributes (e.g., finite-size effects, physical interference, line-of-sight interruptions during communication) and therefore deviate from ideal systems. Consequently, the assumption of power law (i.e., scale-free) distribution might be distorted and needs to be corrected. The deviation is often particularly distinct in the heavy tail. Therefore, one common correction technique is to consider the power law distribution with an exponential cutoff (also known as _truncated power law_) [57]: \[p\left(x\right)=\frac{\lambda\left(\lambda x\right)^{-\alpha}}{\Gamma\left(1- \alpha,x_{min}\lambda\right)}e^{-\lambda x},\] (8) where \(\lambda\) is the scaling parameter of the exponential decay and \(\Gamma(y,z)\) is the upper incomplete gamma function. While Equation (4) directly implies that the feature is scale-free, Equation (8) describes an asymptotic scale-freeness in the limit \(\lambda x\to 0\).