title: Surrogate Assisted Methods for the Parameterisation of Agent-Based Models
authors: Rylan Perumal Terence L van Zyl
text: 
  IEEEexample:BSTcontrol
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  B-.05emi-.025em b-.08em
      T-.1667em.7exE-.125emX
  
  
  P[1]>m#1
  Surrogate Assisted Methods for the Parameterisation of Agent-Based Models
      Rylan Perumal
  School of Computer Science and Applied Mathematics 
  
  University of the Witwatersrand, South Africa 
  
  rylan.perumal@wits.ac.za
  Terence L van Zyl
  Institute for Intelligent Systems 
  
  University of Johannesburg, South Africa 
  
  tvanzyl@uj.ac.za
  
      Aug. 2020
  ==================================================================================================================================================================================================================================================================
  
  
  
  Parameter calibration is a major challenge in agent-based modelling and simulation (ABMS). As the complexity of agent-based models (ABMs) increase, the number of parameters required to be calibrated grows. This leads to the ABMS equivalent of the curse of dimensionality. We propose an ABMS framework which facilitates the effective integration of different sampling methods and surrogate models (SMs) in order to evaluate how these strategies affect parameter calibration and exploration. We show that surrogate assisted methods perform better than the standard sampling methods. In addition, we show that the XGBoost and Decision Tree SMs are most optimal overall with regards to our analysis. 
  
  
  
  Agent-based modelling and simulation, surrogate models, infectious disease epidemiology, machine learning
  
  
  
  § INTRODUCTION
  
  Agent-based models (ABMs) offer the possibility to model many complex real-world scenarios <cit.>. These scenarios range from modelling the spread of an epidemic within a population to modelling trends based on agents' behaviour in the stock market. With the increase in model complexity, the number of parameters that need to be calibrated, to allow the model to match real-world data, grows <cit.>. As a result, searching for meaningful parameter combinations can become computationally prohibitive. Machine learning (ML) models, namely surrogate models (SMs), are capable of effectively searching the parameter space of ABMs. Previously, SMs have been used to classify whether a candidate parameter vector is a good parameter calibration to the ABM to match the real-world data <cit.>.
  
  In this paper we present the results obtained using our implementation of the agent-based modelling and simulation (ABMS) framework shown in Figure <ref> to facilitate the parameterisation challenges of ABMs. In addition, we compare surrogate assisted sampling methods using different SMs. Our results obtained show:
  
      
    * XGBoost and DT SMs perform the best at assisting the parameterisation of ABMs.
      
    * The surrogate assisted method XGBoost Random is is able to get within 98.5% of the optimal distribution with the lowest number of mini-batch evaluations.
      
    * Overall we show that surrogate assisted methods are more likely to estimate the most optimal parameter vector which generates a synthetic data distribution that matches the real data distribution.
      
    * We note the difficulty of calibrating ABMs when one considers that we are trying to estimate only seven of the possible nine parameters using synthetic data and raise the need for further investigation for using real-world data.
  
  
  
  
  
  
  
  
  
  § BACKGROUND
   
  
  
   §.§ Agent-Based Modelling and Simulation in Epidemiology
  
  Agent-based modelling and simulation (ABMS) is an effective technique that is a natural fit for modelling infectious diseases. Agent-based models (ABMs) are capable of modelling interactions between individuals and their environment. Further, they are capable of capturing unexpected emergent patterns and trends during an epidemic, which are the result of combined individual agent behaviours. Each agent within an ABM is provided with different agent characteristics. The agents act autonomously, governed by the interaction of their set of pre-defined rules and distinctive characteristics. As a result, ABMs require sufficient complexity to model almost any complex real-world scenario <cit.>. In addition, ABMS can be used as a substitute for a real-world epidemiological study since it is often not feasible or even possible to run a real-world experiment <cit.>. 
  
  While there are significant benefits to using ABMS for infectious disease epidemiology, there are equally limitations. ABMs ordinarily require long run times due to the increased computational complexity resulting from agent interactions incorporated into the ABM. Additionally, model validation and parameterisation present major challenges in ABMS, specifically in reflecting real-world data. Of these two challenges, we are particularly interested in the parameterisation of ABMs. Difficulty with finding correct parameterisations of ABMs lead to extensive calibration efforts resulting in increased model development time. As more complexity is added to the model, the parameter space expands, leading to the ABMS equivalent of the curse of dimensionality problem. The result is impractical memory and computational costs when searching for meaningful parameter combinations <cit.>.
  
  
  
  
   §.§ Surrogate Models in Agent-Based Modelling and Simulation
  
  One approach to overcoming the computational limitations of ABMS is the use of surrogate models (SMs). SMs are machine learning (ML) models that act as functional approximations to ABMs. In addition, SMs provide a computationally tractable solution to addressing the issues of parameter sensitivity analysis, robust analysis and empirical validation in ABMS. These properties make SMs appealing for approximating significantly complex ABMs that are computationally expensive to validate and calibrate <cit.>.
  
  
  Previously, Gaussian process regression, also known as the Kriging method, has been used as a surrogate modelling approach to facilitate parameter space exploration and sensitivity analysis challenges in ABMS. However, Kriging's performance is dependent on the model's ability to estimate the true spatial continuity of the data <cit.>.
  
  <cit.> presented an alternate approach, overcoming some of the limitations of the Kriging method. An iterative algorithm is proposed for training a SM to effectively approximate the ABM. The novel approach is realised by combining ML and intelligent iterative sampling. It is demonstrated that a model's parameter space can be effectively searched utilising fewer computational resources adopting their approach. In their work the XGBoost non-parametric ML algorithm is used, where the SM is built in a stage-wise fashion, allowing optimisation of an arbitrary differentiable loss function. This method was applied to the Asset Pricing Model by <cit.> and the Island Growth model by <cit.>. The results obtained show that the SM is an accurate functional approximation of the ABM. Further, the SM radically reduced the computation time for large-scale parameter space calibration and exploration. <cit.> improve on the work of <cit.> using the CatBoost ML algorithm. They show the surrogate is able to approximate the ABM and as a result further reduce parameter calibration and exploration time.
  
  
  
   §.§ Quasi-Random Sobol Sampling
  
  <cit.> proposed the Quasi-Random Sobol sampling strategy, used by <cit.> and <cit.>, which belongs to the class of Quasi-Monte Carlo methods. In particular, this approach is ideal when sampling from distributions with an unknown topology such as the parameter space of ABMs for infectious diseases. This approach is able to guarantee uniformity of a distribution by filling up spaces with random points.
  
  
  
  § METHODOLOGY FOR AGENT-BASED MODELLING AND SIMULATION
   
  
  
  
   §.§ Agent-Based Modelling and Simulation Framework
  
  
  Figure <ref> is a representation of our implemented ABMS framework inspired by the algorithm of <cit.>. Our framework starts by selecting the initial configuration. This includes the sampling method, the ML algorithm, the values for the ABM MIN Budget and the ABM MAX Budget limits, a threshold value for the KS test statistic and the confidence criteria. We generate a pool of candidate parameter vectors utilising the sampling method. Subsequently, a mini-batch of these vectors is randomly sampled, where each candidate vector is used as input for the ABM. The ABM generates synthetic epidemic data based on the input parameter vector. We compare the similarity between the distribution of the synthetic epidemic data to the real-world data using Equation <ref> and the corresponding parameter vector is labelled accordingly. Once we have labelled all of the parameter vectors from the mini-batch, we subsequently include these in a ground-truth database. The ground-truth database contains all the parameter vectors we have evaluated and labelled. We employ the ground-truth database to construct an SM using ML techniques and then evaluate if the SM meets the confidence criteria. We either check if we have reached the ABM MIN Budget limit or go to Phase 2. After examining the ABM MIN Budget limit, we either resume at Phase 1 or predict the optimal parameter vector from our database of labelled vectors. We then verify to see if the predicted parameter vector's KS test statistic value is ≤ the set KS Threshold. Depending on the outcome of the check, we either evaluate the ABM MAX Budget limit and go to Phase 2 or stop.
  
  
  
   §.§ Agent-based model
  
  The agent-based model (ABM) used in this framework is a pre-existing model which has been implemented by the Julia library, Agents.jl[https://juliadynamics.github.io/Agents.jl/stable/models/]. The ABM used is a continuous space virus spread model, where the disease transmission dynamics follows the basic Susceptible-Infected-Recovered (SIR) framework, proposed by <cit.>, simulated for 2000 time-steps. The SIR framework models the ratio of susceptible, infected and recovered individuals within a population. Table <ref> contains the true input parameter values of the ABM that we have considered for parameterisation. Parameters 1, 2, 3, 6 and 7 are sampled between the range (0, 1)  and parameters 4 and 5 are sampled between the range (0, 41) days. We have chosen the number 41, which equates to 1000 time steps (half of the total) in our ABM, as our upper bound to allow the sampling methods to generate candidate parameter vectors where the Infection Period and Detection Time are greater than true value.
  
  
  
  
  
   §.§ Kolmogorov-Smirnov Test
  
  
  The two-sample Kolmogorov-Smirnov (KS) test is used to compare the distributions of the simulated data to the real data as follows:
  
      D_R, S = sup_x| F_R(x) - F_S(x) |,
  
  where x represents the feature we are measuring (number of infected individuals) and F_R and F_S are the distribution functions of the real and simulated data respectively <cit.>. The KS test requires the cumulative distributions of the samples being compared to be calculated. The 99% critical value is used to reject the null hypothesis (two distributions are the same). The corresponding parameter vector is labelled as negative if the two distributions are not the same and positive if the two distributions are similar as seen in Figure <ref>. In addition, the data distributions that we are comparing are time series. The empirical KS test is formulated to assess the distance between two independent and identically distributed samples. To use the KS test on our time-series data, we convert the time-series to a cumulative distribution function by first performing a cumulative sum along the time dimension. We then scale the cumulative sum so as to arrive at a cumulative distribution which maintains the integrity of the time-series. This makes our problem scale-invariant to the population size simulated by the ABM, which allows us to measure the similarity of the exact epidemic trends between the two time-series distributions.
  
  
  
   §.§ Sampling Methods
  
  
  
    §.§.§ Random Sampler
  
  This sampling technique is used as our baseline. We generate N random candidate parameter vectors. The length of all the candidate parameter vectors generated are dependent on the number of parameters we are parameterising.
  
  
  
    §.§.§ Surrogate Assisted Random Sampler
  
  To improve the accuracy and efficiency of the random sampler, we propose the surrogate assisted random sampler. Once we have a confident SM, we then re-generate a new set of random candidate parameter vectors. The new set is passed as input to the SM which classifies the candidates as positive or negative parameter calibrations. The parameter pool is then re-initialised using an ϵ-greedy algorithm. We select positively predicted candidates 90% of the time and selecting negatively predicted candidates 10% of the time. This encourages exploration of the parameter space. This will drive our sampling method to mostly generate candidate parameters vectors which it classifies as positive calibrations.
  
  
  
    §.§.§ Quasi-Random Sobol Sampler
  
  We have used the Sobol.jl[https://github.com/stevengj/Sobol.jl] package from the Julia library which is based on the works of <cit.> and <cit.>. This sampling method generates low-discrepancy-sequences of points that are equally distributed around an N-dimensional hyper-cube. 
   
  
  
    §.§.§ Surrogate Assisted Quasi-Random Sobol Sampler
  
  In addition, we propose the surrogate assisted quasi-random sobol sampler. This sampling method functions in the same way as the surrogate assisted random sampler. The only difference between the two methods, other than the SM used, is that one generates pseudo-random samples and the other quasi-random sobol samples.
  
  
  
  
   §.§ Surrogate Models
  
  We evaluated the following machine learning algorithms for learning surrogate models:
  
      
    * eXtreme Gradient Boosting (XGBoost): A decision tree based machine learning algorithm, which is based off the framework by <cit.>, that is scalable and efficient in its implementation <cit.>.
      
    * Decision Tree (DT): A classification algorithm which works off a tree-like structure, where the nodes represent a feature/attribute and the branches represent the decision rule which leads to the outcome of that decision <cit.>. 
      
    * Support Vector Machine (SVM): A classification algorithm which finds a hyperplane in an N-dimensional space in order to differentiate between different classes of data points <cit.>.
  
  The ground-truth database of labelled parameter vectors is used at each iteration to train a SM. We split the database into a training and validation set using an 80/20 split. The machine learning algorithm is trained using the training set and the F1 Score is evaluated on the validation set. The confidence of the SM, measured by accuracy on the validation set, should increase as additional examples are stored in the ground-truth database.
  
  
  
  
   §.§ Sanity Check
  
  To ensure that our implemented ABMS framework in Figure <ref> is reliable, we need to conduct a sanity check. Given a set of known optimal parameters, θ^*, we use this as input for the constructed ABM. The ABM will then generate a synthetic dataset based on the value of θ^* as output. We subsequently use the synthetic dataset as the ground truth real-world data in Figure <ref>. Thereafter we run through the ABMS framework and observe if we are able to approximate θ^*.
  
  
  
   §.§ Experiment Setup
  
  
  
    §.§.§ Initial ABMS Configurations
  
  The following initial configurations are set as: ABM MIN Budget = 500, ABM MAX Budget = 2500, Batch Size = 50 and KS Threshold = 0.005 (≈ 99.5% similar to the true distribution). Lastly, the confidence criteria of the SM is set so that we have at least evaluated a proportional number of candidate parameter vectors, dependent on the Batch Size and the number of parameters we are parameterising, at a validation F1 Score ≥ 0.90. We conducted a total of 56 experiments, averaging each experiment 10 times, where for each average the true parameters were varied. We compared all of the sampling methods implemented, parametersing parameters 1, …, 7 as seen in Table <ref>.
  
  
  
  
  
  
    §.§.§ Hardware Specifications
  
  The machine used to run our experiments consisted of an Intel Xeon CPU E5-2683 v4 @ 2.10GHz processor with 64 CPUs and 256GB of RAM using the Ubuntu 18.04.4 LTS operating system.
  
  
  § RESULTS
  
  We evaluate the performance of the various surrogate models, random sampler and quasi-random sobol sampler in the context of the following metrics:
  
      
    * L_2 Norm: The euclidean distance between the true input parameter vectors and the optimal predicted parameter vectors.
      
    * KS Test Statistic: The maximum distance between two empirical time-series cumulative distributions functions. The similarity of the time-series distributions increases as this value tends to 0.
      
    * Mini-batch Evaluations to Success (BMS): Success is defined as quality criterion that needs to be achieved i.e. a solution within 99% or 95% of the known optimal parameter values. BMS is the number of mini-batches the framework required to reach success, i.e. the BMS at a success of 99% would be the number of mini-batches used to get to within a 99% of the optimal value.
  
  Table <ref> contains standardised the L_2 Norm and KS test statistic values for each of the methods that we have implemented, calibrating parameters 1, …, 7. Figure <ref> shows the results of KS test statistic values seen in Table <ref>. The results we have obtained clearly illustrate that trying to parameterise more than 3 parameters results in a gradual decrease in performance as measured by the KS test statistic. 
  
  
  The top of Figure <ref> shows that Decision Tree Random consistently outperforms Random for parameters 1, 2, 3, 4, 5 and 7. XGBoost Random outperforms Random for parameters 1, 2, 3 and 7. The bottom of Figure <ref> shows for parameterising parameters 1, …, 7, that Decision Tree Sobol outperforms Sobol for all parameters. The results from Table <ref> and Figure <ref> clearly illustrate that XGBoost and DT surrogates are able to get the lowest KS test statistic values and also the lowest L_2 norm values overall.
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  Table <ref> contains the averaged minimum number of mini-batch evaluations it took to reach the optimal predicted parameter vector. The table also details the number of mini-batch evaluations to succeed at different percentage intervals for parameterising 7 of the ABM's parameters.  XGBoost Sobol is able to reach success at 97% and 97.5% in only 14.3 and 20 mini-batch evaluations on average respectively. XGBoost Random and SVM Sobol are able to reach success at 98% and 98.5% respectively in the least amount of mini-batch evaluations on average. As we scale the problem size and the complexity of the ABM, we may find that doing so many mini-batch evaluations is computationally infeasible to reach that level of success.
  
  
  
  
  
  
  § CONCLUSION
   
  We have implemented an ABMS framework which allowed us to effectively swap out and replace alternative sampling methods and surrogate models. In addition, the framework allows us to evaluate the performance of parameter calibration and exploration challenges in ABMS. To be specific, we are interested in utilising our approach for infectious disease epidemiology. Our results demonstrate to us that the surrogate assisted methods perform much better than the Random and Quasi-Random Sobol sampling methods. In addition, employing an XGBoost and DT surrogate is most optimal at assisting the sampling methods with regards to approximating the real data distribution. Our future work aims to improve on our ABMS framework but include different aspects of optimisation and to evaluate more intelligent sampling methods and ML algorithms to learn SMs.
  
  [heading=bibintoc]
  
  
  