A sample script for using the Calibration class to generate the optimal set of free parameters, run a sim with that set of free params, and then generate plots showing the discrepancies between the model vs data.
PRIOR TO RUNNING: 1. Be sure to set the user global variables in the first section below (country, plotting options, save option, and skyscrapers dataset name)
2. Ensure that fpsim/locations contains both a directory for the country being calibrated as well as a corresponding location file (i.e. ‘ethiopia.py’)
3. In order to run this script, the country data must be stored in the country directory mentioned above and with the following naming conventions:
skyscrapers.csv’ # Age-parity distribution file use.csv’ # Dichotomous contraceptive method use birth_spacing_dhs.csv’ # Birth-to-birth interval data afb.table.csv’ # Ages at first birth in DHS for women age 25-50 cpr.csv’ # Contraceptive prevalence rate data; from UN Data Portal asfr.csv’ # Age-specific data fertility rate data mix.csv’ # Contraceptive method mix tfr.csv’ # Total fertility rate data popsize.csv’ # Population by year
4. Ensure that the data in the aforementioned files is formatted in the same manner as the kenya data files, which were used as a standard in writing this script.