# Scale-Free Features in Collective Robot Foraging
## 2 Methods
### Data Analysis
#### 2.4.1 Power Law Fitting Procedures  
To verify whether a feature is scale-free, we use a set of techniques that are described in [53, 54, 55] for fitting its distribution by the _power law distribution_. The power law distribution takes the form of a straight line on a log-log scale of \(p(x)\). However, most real-world data displays significant fluctuations due to randomness. When fitting power law to the data, random fluctuations are considered by the statistical value \(p\) which represents the _goodness-of-fit_. When \(p<0.1\) the power law fit can be considered to be unreliable [54]. Furthermore, power law behavior emerges mostly only in the tail of the distribution, i.e., for higher values of \(x\) above a statistically determined lower bound \(x_{min}\)[53]. Please note that this effectively reduces data set to fit by the power law, which is important to keep in mind by considering a ratio of the total number of data points to the points that satisfy the condition \(x>x_{min}\). Finally, there are several other statistical distributions that may resemble the characteristic straight-line tendency of a power law on a log-log plot. Hence, for a sound statistical analysis it is important to compare the power law fit to other statistical models [54, 55, 56]. More precisely, the power law fitting procedure can be summarized by the following three steps:  
1. Using maximum likelihood estimation, fit the data by the power law distribution \[p\left(x,x_{min},\alpha\right)=\frac{\alpha-1}{x_{min}}\left(\frac{x}{x_{min}} \right)^{-\alpha},\] (4) where \(\alpha\) is the scaling parameter and \(x_{min}\) is the lower bound. In particular, \(\alpha\) and \(x_{min}\) are estimated using procedures described in [54].
2. Apply Kolmogorov-Smirnov statistic to carry out the _goodness-of-fit_ tests and verify the above results. Here, essentially, a large set of synthetic data is generated from a power law distribution (with \(\alpha\) and \(x_{min}\) found in 1.) and their distances to their respective fits are compared to the distance between the empiric data and the best-fit found in step 1. The outcome of this procedure is the \(p\)-ratio which estimates the contribution of random fluctuations. If \(p<0.1\) the power law fit found in step 1 is very likely to be due to inherent randomness in the empiric data. Moreover, the \(p\)-value is unreliable when the data set is too small. Therefore, the percentage of data points \(N_{data,pl}\) that lie above \(x_{min}\) should be 10% or higher.
3. Finally, even if \(p>0.1\), the power law fit might be not the only model that fits the data well. Consequently, complete the above steps for a set of other potential distributions including exponential or lognormal distributions. Then, compare the resulting best fits to the one obtained for the power law by computing the ratio \(R\). The latter is defined as the log likelihood of the power law over the log likelihood of another distribution. If \(R>0\), power law is the statistically superior fit. Although this last step still does not give us the certainty that the data is power law distributed, it makes the hypothesis more plausible. For this step we used an open-access Python toolbox [56].