# Simulation of Calibrated Complex Synthetic Population Data with XGBoost
### Outline  
The framework and workflow are illustrated in Figure 1. Essentially, the framework comprises three steps, with the second and third steps introducing new contributions to literature and software. The three items below match the numbers in Figure 1.  
1. The synthetic hierarchical structure is simulated, e.g., age and gender of persons in households.
2. Synthetic data simulation with XGBoost to simulate synthetic population data with (possible) complex structures (like persons in households) from complex samples with (possible) complex sampling plans.
3. Calibration of the simulated population to known margins with a new calibration technique that allows multiple margins for different information (e.g., household information and personal information simultaneously).  
All these steps might be needed to simulate realistic synthetic populations, and we show the benefits of these new developments.  
The remainder of the essential parts of the article is structured as follows.  
* In Section 2.3, the well-known XGBoost method is introduced in a general manner. After this short introduction, the simulation of the synthetic population is shown.
* The first aim is to create a synthetic structural file (Section 2.2, cf. Figure 1, first point) that includes the cluster information.
* Using the information of the non-anonymized data and the synthetic hierarchical/cluster structure, the remaining variables can now be simulated using XGBoost (cf. Figure 1, second point). While random forests build their regression trees independently (for each variable to be simulated), XGBoost improves the selection of trees at each step. XGBoost thus generally combines two important aspects: non-linear adjustments and improvements (due to a loss function) in each selected tree. The adaption of XGBoost to be used to simulate synthetic variables is described in Section 2.3.3 and the information used is visible in Figure 1. The cross-validation procedure to determine the hyperparameters in XGBoost is also reported in Section 2.3.4. After simulation of the synthetic population (see Figure 1, third step), the quality of the simulated data is discussed in Section 2.4.
* Section 3 then shows how the simulated population can be calibrated to known multiple population margins (e.g., margins on households and information on persons  
Figure 1: The workflow to produce a synthetic population and to calibrate it. The contribution covers the large light blue area together with the synthesis step 2 using XGBoost. The corresponding text passages are linked to section numbers in the Figure.  
in Section 3.2) considering the cluster structure in the data. Several subsections (Sections 3.3-3.5) are dedicated to this problem. Note that the draft version of this calibration method was already implemented in the R package simPop but has never been published in a scientific journal, and we have considerably extended the methods within this contribution.
* Section 3.6 shows the impact of calibration on several statistics.
* Section 4 discusses the implications of these methods for applications and science.
* Since we have also implemented the methods in software, we outline the use of this software using complex data sets in the Appendices A-C. The corresponding data set is described in Section 2.1. The illustration with code in an application allows the reader to see the connection from theory to application in software and to obtain an impression of how the methods can be used in practice.