# Mathematical Modeling and Simulation of Logistic Growth
## 3 Materials and Methods
### Parameter Space Exploration and Tuning  
We have performed the designed simulation 100 times, with different parameter settings, to explore the resulting scenarios with an unbiased approach and single out a configuration of parameters to conduct the output analysis upon and the comparison with [PERSON]'s method. We have kept \(r\), or \(R-D\), and the number of iterations fixed to 0.05 and 500, respectively: lowering the discrete growth rate to 0.02 or 0.01, to obtain a percentage error closer to 0%, implied increasing the simulation execution time, so we chose the first \(r\) greater than 0.02 from Table 1, while the selected number of iterations showed all the phases of logistic growth, including the long-term behavior.  
We chose the ranges of the initial population (\(N_{0}\)), crowding coefficient (\(c\)), and reproduction (\(R\)) or death (\(D=R-r\)) probability to be \(1\leq N_{0}\leq 51\), \(10^{-5}\leq c\leq 10^{-4}\)and \(0.05\leq R\leq 1\) (\(0\leq D\leq 0.95\)), with matching steps of 2, \(10^{-5}\), and 0.05. In this way, the theoretical \(L\) shifts from 5000 to 500 creatures (by one order of magnitude), and the parameter space dimension is 26 (values of \(N_{0}\)) \(\cdot\) 20 (values of \(R\)) \(\cdot\) 10 (values of \(c\)) \(\cdot\) 500 (number of iterations), for a total of 5200 different combinations of parameter settings and \(2.6\cdot 10^{6}\) values of \(\mu(N_{i})\), or iteration means.  
After restricting the parameter space dimension to the last 200 iterations, when growth is already stationary, we take the (grand) mean of the corresponding \(\mu(N_{i})\) values, for each parameter setting, to obtain the observed \(L\) values (95% confidence intervals (computed with the bootstrap method) of the 5200 observed \(L\) values are given in Supplementary Table S1). The scaled absolute difference \(\Delta L\) between the observed and theoretical \(L\) was used as a measure of the distance of the stochastic model from the mathematical one, and the interplay between the simulation parameters \(c\), \(N_{0}\), \(R\), and \(D\) was analyzed to understand their impacts on the ability of the population to reach the theoretical \(L\). In particular, tuning consisted of the observation of the pairwise relationships between \(\Delta L\) as a percentage and each parameter evaluated regarding its range of values, seeking to choose the one that minimized the gap between the theoretical and observed \(L\). The resulting \(R\), \(D\), and \(c\) values were used to set the corresponding \(R\) and \(D+cN\) threshold probability values of the rejection sampling process, as described in Section 3.1. We note that the tuning of \(N_{0}\) ensures that the simulation eventually reaches steady-state behavior, by setting the initial \(N\) of the \(D+cN\) threshold probability value.  
We have also performed a small-scale test of the PRNG by analyzing 100 different streams of data points, matching 100 single simulation runs, each containing 500 iterations, multiplied by the two probabilities applied for \(R\) and \(D+cN\), respectively, and by the number of creatures alive per iteration, which we set to 100, for a total of \(100,000\) data points per stream. To check the absence of correlations between different streams, we reviewed their pairwise Spearman rank correlation coefficient matrices and \(r\) Pearson coefficients, while the one-sample Kolmogorov-Smirnov and chi-squared goodness-of-fit tests were performed on each stream to see whether it followed a uniform distribution.