# Scenario Optimisation and Sensitivity Analysis for Safe Automated Driving Using Gaussian Processes
## 5 Method for Scenario Optimisation and Data Acquisition through Simulation
### Initial Scenario Data Set and Data Generation via Simulation  
In order to represent a logical scenario with a GP model, an initial data set of concrete scenarios is necessary to accurately train the GP model. In this section, we briefly describe the sampling method used to construct an initial data set that is optimally suited to train the GP models.  
Figure 2: Overview of the automated vehicle (AV) Scenario Optimisation Method.  
We use a Latin Hypercube (LHC) design to create an initial data set of predefined size [41]. In LHC, the scenario space is divided into equal parts, so-called Latin Hypercubes, where the sampling positions are randomly chosen from the input probability distribution. This ensures that the entire scenario space is covered as evenly as possible, without leaving large areas uncovered or areas where many samples are densely packed.  
The LHC design has been found to be superior to a random sampling strategy (MC sampling) for modelling logical scenarios [8]. In a numerical experimental study conducted by Reference [42], it was illustrated that the sampling error for MC is 20 times larger than for the LHC based sampling method. However, the published theoretical results show that the sampling error of the MC goes down as \(\mathcal{O}(n^{-1/2})\), whereas the sampling error for LHS is \(\mathcal{O}(n^{-1})\), quadratically faster, for almost all distributions and statistics in common use. In other words, if you need \(n\) samples for a desired model accuracy using LHC, you will need \(n^{2}\) samples for the same accuracy using MC sampling method [37].  
While it is possible to increase the size of an MC sample data set by generating more data from the uniform distributions of input parameters, the same is not possible for data sets designed with the LHC method. The sample, based on the LHC sample method, will be optimally generated according to the requested sample size and the range of input parameters. As the computational complexity of training a GP model is \(\mathcal{O}(n^{3})\), a relatively small initial set of 100 concrete scenarios is chosen. A GP model trained on this data set is sufficient for use in the search algorithm described in Section 5.3.  
Once a data set of concrete scenarios is available, the concrete scenarios are passed to the simulator to be executed, as shown in Figure 2. Here, the functional scenario is modelled and evaluated in the vehicle simulation software CarMaker [32]. The ego vehicle, along with the actors and geometric layout of the scenario are therein modelled in a way, that the scenario parameters can be set to the concrete values provided by the initial data set and the optimisation algorithm. Section 6.1 describes the modelling of the exemplary scenario in detail.  
The drawback with this approach is, that with a change in the logical scenario, the modelling in the simulation needs to be adapted and the optimisation conducted again. The advantage of using simulation, however, is the ability to swiftly generate the required simulations of the concrete scenarios from the given logical scenario. It also provides all the necessary measurements to assign a score to each concrete scenario, indicating the outcome, and thus enabling the construction of a data set, which can be used to train the GP surrogate models.