Optimizing climate related global development pathways in the global calculator using Monte Carlo Markov chains and genetic algorithms

Abstract Novel pathway optimization methods are presented using the 'Global Calculator’ model and webtool 1 to goal-seek within a set of optimization constraints. The Global Calculator (GC) is a model used to forecast climate-related develop pathways for the world’s energy, food and land systems to 2050. The optimization methods enable the GC’s user to specify optimization constraints and return a combination of input parameters that satisfy them. The optimization methods evaluated aim to address the challenge of efficiently navigating the GC's ample parameter space (8e70 parameter combinations) using Monte Carlo Markov Chains and genetic algorithms. The optimization methods are used to calculate an optimal input combination of the ‘lever’ settings in the GC that satisfy twelve input constraints while minimizing cumulative CO2 emissions and maximizing GDP output. This optimal development pathway yields a prediction to 2100 of 2,835 GtCO2 cumulative emissions and a 3.7% increase in GDP with respect to the “business as usual” pathway defined by the International Energy Agency, the IEA’s 6DS scenario, a likely extension of current trends. At a similar or lower ambition level as the benchmark scenarios considered to date (distributed effort, consumer reluctance, low action on forests and consumer activism), the optimal pathway shows a significant decrease in CO2 emissions and increased GDP. The chosen optimization method presented here enables the generation of optimal, user defined/constrained, bespoke pathways to sustainability, relying on the Global Calculator’s whole system approach and assumptions.


Introduction
The Paris Agreement [1] states that the increase in global average temperature must remain below 2 C [2]. To achieve this sustainability goal, transition scenarios are helpful as they examine combinations of events that may seem idealistic and improbable but are possible, as stated by the Global Scenarios Group [3]. Several scenario-planning exercises have been conducted in recent years at a range of spatial scales and for a range of purposes [4], including: global futures [4][5][6][7], regional futures [8,9], corporate strategy [10,11], political transition [12] and community-based natural resource management [13,14].
In the context of scenario planning, energy forecast models are frequently used to assess a wide range of climate change mitigation scenarios and inform the climate debate at an international level. Policymakers, business leaders, NGOs and researchers use them to design their version of the future, see the implications for the climate, and take decisions in the present accordingly [15,16]. This paper focuses on optimizing such an energy forecast model, "The Global Calculator" (GC), to generate pathways to sustainability. The GC is an interactive system dynamics model of energy, land and food systems to 2050. It is a didactic tool rather than a tool for detailed energy planning and/or for informing new business investments. Users of the GC develop climate change mitigation pathways by interacting with the model through a user-friendly and dynamic web tool or an MS Excel spreadsheet dashboard. There are several other calculators available online, including many national calculators [17][18][19].
Other significantly more advanced energy forecast models include the IEA's [20] or Shell's [21] World Energy Models. In mathematical modelling, these models are dynamic, balancing supply and demand through energy pricing with a resolution of up to a minute. They are also updated yearly to increase their precision and suitability for each point in time, accounting for the most recent policies and events, such as the Covid-19 pandemic. In terms of geographical scope, these models are detailed, with country-level inputs and outputs. Nevertheless, the optimizer presented in this paper is applied to the GC for two reasonsthe GC is free and open source, enabling straightforward testing of the optimizer, and has a manageable complexity, potentially saving thousands of lines of code. The GC allows the user to select from four levels of climate mitigation ambition for each of its 48 inputs (levers). The four levels of ambition are standardized across all the levers as follows: Minimal abatement effort, ambitious effort, very ambitious effort and extreme and transformative effort. Note that an abatement level of 1 does not necessarily mean a "minimal abatement" in the GC, as for some levers level 1 involved the aggravation of current trends which can be worse than just a reduced effort.
Currently, creating a pathway with the GC involves selecting a value for each of its 48 inputs by hand. Trial-and-error confirms the difficulty of achieving the 2 C warming limit this way. Each of the GC's levers includes a detailed explanation to aid the user whilst selecting the input value. However, it can prove time-consuming to browse through each of the 48 lever explanations. On the other hand, optimizing the GC's inputs has proved challenging to date as there are 8e70 2 possible input combinations. This paper presents an optimization method that, based on user-specified constraints, rapidly generates optimal lever and ambition level combinations for the GC. It does so by using Monte Carlo Markov Chains (MCMC) and genetic algorithms. The optimization method finds optimal input combinations even under sometimes conflicting objectives, such as mitigating climate impact and increasing economic output.
A sample pathway to 2050 that satisfies twelve input constraints 3 and two output inequality constraints is calculated by the optimization method and presented in this paper. This optimal pathway yields a significant decrease in forecasted cumulative emissions, as well as an increase in GDP output with respect to the 'distributed effort', 'consumer reluctance', 'low action on forests' and 'consumer activism' pathways published in [22][23][24]. The optimization method takes up to a few minutes to converge, depending on the complexity of the user's constraints. It is guaranteed to find a solution unless none exists for the specified constraints. The optimization method gives equal weight to all the constraints by default, but the user can change this to account for trade-offs between constraints. As such, it is expected that end users can use the optimization method presented in this paper to generate pathways for the GC that meet their constraints. This has the potential to yield optimal pathways to sustainability rapidly.

Methods
This section outlines the technical considerations evaluated in choosing the two methods used in this investigation: MCMC and genetic algorithms.

Studying the inputs of the global calculator: MCMC
Applying MCMC to the GC yields the posterior distribution of inputs that maximize the likelihood of meeting user-specified constraints such as minimizing greenhouse gas emissions and maximizing GDP output. This method has previously solved similar problems in the fields of Bayesian statistics [25], computational physics [26], computational biology [27] and computational linguistics [28]. Note that the GC's GDP output is an approximate estimation, given that it provides a consequential estimate that is based on values obtained from the TIAM energy model, rather than on an econometric simulation. Moreover, it does not reflect the adaptation costs that different temperature changes would involve worldwide.
There are two key metrics used to determine the efficacy of an MCMC implementation, its acceptance rate, and the autocorrelation coefficient between accepted pathways. In this context, the acceptance rate is defined as the ratio between the number of accepted pathways and the number of proposed pathways. On the other hand, the autocorrelation coefficient is used to measure serial correlation between accepted pathways. A well-adjusted MCMC implementation must have a high acceptance rate and low autocorrelation coefficient between accepted pathways. Adjusting the parameters of MCMC is a highly empirical task.
Algorithm 1 shows the steps taken to adapt MCMC to the GC in two dimensions ( Figure 1).
To enforce the two output constraints (2 D case), a set of 200 observations is randomly drawn from a 2 D Gaussian distribution with its mean centered below the 3,010 GtCO 2 cumulative emissions mark (corresponding to the 2 C warming target) and at a positive increase in GDP with respect to the "business as usual" pathway assumed, the IEA's 6DS scenario. Even though other scenarios might be more feasible in the present, the IEA's 6DS scenario has been assumed as it was defined by the IEA and used as the default scenario for the GC at the beginning of 2015. The IEA's 6DS scenario represents a likely extension of 2015 trends and is part of the IEA's Energy Technology Perspectives.
These observations' standard deviation is determined empirically to maximize the acceptance rate and minimize the autocorrelation coefficient of accepted samples.
The likelihood function is also a 2 D Gaussian, where its standard deviation is directly related to the acceptance rate. This value can be changed to adjust the weight given to the observations. On the other hand, interacting with the GC yields prior knowledge about the empirical distribution of the output constraints. A set of 300 different random lever combinations is generated, bounding their values between 1.5 and 3.5 to avoid unrealistic ambition levelsoutputs arising from lever values below 1.5 and above 3.5 are usually considered extreme and unlikely. These bounds pre-empt the optimizer from generating pathways which might be overly ambitious. A Gaussian distribution is fit to the resulting values. Ready-made MCMC samplers cannot be applied to the GC as the map between model inputs and outputs is unknown. A discrete variation of the Metropolis-Hasting sampler is used, where each lever is moved by some distance according to the probability distribution shown in Table 1.

Optimizing the global calculator using genetic algorithms
Optimizing the GC's inputs poses a challenge as the constraints specified by the user might conflict with each other (as in [29]), such as minimizing climate impact and maximizing economic output. Genetic algorithms successfully tackle similar multi-objective optimization problems [30,31], so they are used to optimize the GC's inputs. The optimization method proposed in this paper takes different types of constraints, as listed in Table 2.
The optimization constraints are accounted for in the cost function through a Mean Squared Error (MSE) metric between current and target values. The GC's outputs have different units and scales, so they are normalized to balance the cost function. This is achieved by approximating the standard deviation of each output by generating 100 random lever combinations. Each iteration of the optimizer is known as a generation, and the number of lever combinations used in each generation is referred to as the population size. In this case, the population size has been set to 20 as a compromise between accuracy and efficiency. There is a selection operator which finds the two lever combinations with the lowest cost values and a crossover operator that performs uniform crossover with these two to find a new lever combination. The mutation operator introduces randomness in the crossover process to avoid getting stuck in local minima. In the context of the implementation presented on this paper, a mutation rate of 20% has shown to work well in practice. On the other hand, the GC's outputs are sensitive to changes in the levers, which make pre-made mutation operators perform poorly. A simple bespoke operator is created, where the lever value that mutates is randomly increased or decreased by 0.1. This is illustrated in Table 3, where each new lever value is chosen from either parent with probability 0.5. Green cells show the values passed on to the child, whereas red ones correspond to those discarded. Blue cells correspond to mutated values.
Algorithm 2 shows the multi-objective genetic algorithms optimizer applied to the GC ( Figure 2).
The results are split into two sub-sections: firstly, the MCMC analysis, providing probability distributions that maximize the likelihood of sustainable pathways; and secondly, the optimization using genetic algorithms, showing a sample pathway calculated with the optimizer.

Results
The results herein presented are based on the GC's base year, 2011, corresponding to v.3.99.0 of the GC's spreadsheet and v23 of the GC's webtool. Some pathways and cost implications might change in future updates of the calculator.
The reader should also note that greenhouse gas removal (GGR) levers were also assessed in the optimization. GGR levers were illustratively included in the GC given the many uncertainties involved in the future expansion, if any, of these technologies. GGR levers available in the GC have substantial energy penalties assumed and were not associated with GDP impacts in the model.

Results from applying MCMC to the global calculator
These results stem from running a two-dimensional MCMC with two inequality output constraints that are common amongst most pathways generated by users: Minimizing greenhouse gas emissions and maximizing GDP output. MCMC ran for over 24 hours, resulting in 21,300 different proposed parameter combinations. Figure 3 shows the distribution of outputs that result from accepted parameter combinations, where greenhouse gas emissions are centered around 2,950 GtCO 2 , and GDP output is centered around a 0% increase with respect to the BaU pathway. Around half of the parameter combinations proposed is rejected. Figure 4 shows the acceptance rate as a function of parameter proposals, oscillating around 0.5.
MCMC has led to the probability distributions of inputs that maximize the likelihood of minimizing greenhouse gas emissions and maximizing GDP, as shown in Figure A (Appendix A). Figure B.1 (Appendix B) presents the correlation matrix of lever values that maximize the probability of meeting the two inequality constraints. This idea is then Table 3. Genetic algorithms crossover and mutation of two parent pathways to yield a child pathway.  where green corresponds to strong positive correlations and magenta to negative ones. On the other hand, a section of the paired density and scatter plot matrix is presented in Figure B.3 (Appendix B). It includes the relationships between accepted lever values of fossil fuels and renewables.

Results from the genetic algorithms optimizer
The results presented in this sub-section come from running the genetic algorithms optimizer for two inequality output constraints and twelve interval input constraints, as listed in Table 4. Figure 5 shows the model outputs' evolution towards an optimal lever combination, as calculated by the optimization method after nine generations.
As can be seen in Figure 6, the optimizer does so by minimizing the objective function.
The calculated pathway yields a forecast to 2100 of 2,835 GtCO 2 , which is below the 3,010 GtCO 2 level corresponding to the 2 C warming target. Note that the temperature change is modelled by 2100, whereas the GC's levers provide pathways by 2050. Between 2050 and 2100 the GC user has the option to explore different emissions trajectories (as shown at the end of Table 5 in Appendix C), but these are just theoretical extrapolations of the total emissions trajectory simulated by 2050 and are not an outcome of any technological modelling.
The pathway also forecasts an increase of 3.7% in GDP by 2050 with respect to the BaU pathway. The complete forecast produced by the optimizer for the given constraints can be accessed at [32]. Table  5 (Appendix C) contains the optimal pathway's lever values compared to the four benchmark scenarios (distributed effort, consumer reluctance, low action on forests and consumer activism), and to the BaU pathway: IEA's 6DS pathway.

Discussion
The discussion section is structured similarly to the results section.

The MCMC output
As stated in [33], there are many theoretical pathways to meeting the 2 C warming target in the future. As such, the GC has been used to generate several different pathways that can meet this target, as shown in Figure 3. Out of the GC's space of 8e 70 unique pathways, MCMC proposed c.21,300 pathways which were likely to meet the warming target whilst increasing GDP output, and 10,650 of them were accepted. The acceptance rate of around 50% attained for the MCMC implementation presented here (as shown in Figure 4) shows that the method works well for exploring sustainable and economically viable pathways. The charts presented in Figure A (Appendix A) help users of the GC select individual lever values that are likely to yield sustainable and economically viable scenarios. Figure B (Appendix B) shows input combinations that might work best together. Correlations between lever values appear to be frequent, suggesting that most inputs can be offset by changing other levers.  Furthermore, Figure B.3 (Appendix B) presented a novel visual way for understanding relationships between accepted model inputs. For example, it shows that wind energy and bioenergy yields are inversely correlated, indicating that a high value of wind energy could be accompanied by a low value of bioenergy yields to maximize the probability of meeting the climate and economic targetsalthough correlation does not necessarily mean causation in this case. The chart presented in Figure B.2 (Appendix B) serves as a guide for selecting input lever combinations that maximize the probability of satisfying the optimization objectives. For example, a high level of solar energy combined with a low level of marine energy would maximize such a probability.

The genetic algorithms optimizer
The genetic algorithms optimizer enables the user to specify different types of constraints and returns lever combinations that satisfy them. The number of generations needed before convergence depends on the number of constraints set, but heavily constrained problems have been solved in a maximum of nine generations. Its mutation operator and rate, and crossover operator have been successfully adapted to the GC to maximize the method's convergence rate.
As shown in Figure 5, the optimization method presented progressively satisfies the two inequality output constraints of minimizing GHG emissions and maximizing GDP output while maintaining the other twelve input constraints. Most of the calculated lever values have been set to a more ambitious level than the BaU pathway, which could be controlled by setting more restrictive constraints. Together with other sustainable pathways, the lever combination calculated suggests that ambition efforts must be increased overall to meet the climate warming target whilst ensuring economic viability. The optimization shows that the assessed scenarios, as described in Table 5, except for the IEA's 6DS, offered very similar GHG emissions reduction levels. The optimal pathway, however, was able to provide a substantial GDP gain, whereas only consumer activism was able to provide a positive GDP impact among these assessed pathways.
On the other hand, the optimal pathway's overall ambition level is smaller or equal to that of the 'distributed effort', 'consumer reluctance', 'low action on forests' and 'consumer activism' pathways. Furthermore, the optimal pathway achieves lower cumulative emissions and higher GDP output.

Advantages and disadvantages of using MCMC and GA
The main advantages and disadvantages of using the MCMC and GA implementations presented in this paper are listed in Table 6. In summary, MCMC has a long runtime but can provide a distribution of lever values that maximize the likelihood of meeting a few inequality constraints. On the other hand, GA rapidly converges to a combination of lever values that meet several equality and inequality constraints when provided with a sensible initial lever combination. In practice, using MCMC to find initial values to feed to the GA optimizer has worked well.

Conclusions
MCMC can be applied to the GC and used for calculating probability distributions of inputs that maximize the likelihood of a climate-friendly and economically viable future. These distributions summarize each of the levers' numerical impact and could be used to help the users of the GC in selecting lever values by hand. The MCMC results show that at least 10,650 GC pathways have the potential to meet the 2 C warming target while also improving the GDP output. Additionally, these distributions improve the convergence of the optimization method presented in this paper.
The genetic algorithms optimizer has succeeded in finding optimal input combinations for the GC under multiple and sometimes conflicting constraints. It yields quick and bespoke pathways to sustainability despite the seemingly daunting 8e70 possible pathways. The pathway presented shows how a significant reduction in GHG emissions and an increase in GDP could be attained by 2050 by increasing the overall ambition effort. Furthermore, this optimal pathway displays a lower level of GHG emissions and higher GDP with respect to the four benchmark scenarios, at a similar ambition effort: 'Distributed effort', 'consumer reluctance', 'low action on forests' and 'consumer activism'. These five pathways still seem to require an increase in the levels of effort across all sectors as they average a lever value of 2.3, which is c.35% above the BaU's pathway average lever value of 1.7. The optimization method enables users of the GC to quickly explore different sustainable pathways to gain a deeper understanding of sustainable energy trade-offs. Further work would involve adapting the optimizer to other calculators, extending MCMC to higher dimensions to set more than two output inequality constraints and parallelizing the genetic algorithms optimizer to speed-up calculations. Notes 1. Publicly available online, at "http://tool. globalcalculator.org" 2. Based on the GC's 48 inputs, and the 30 values that each of these inputs can take (i.e., 30 48 ) 3. Twelve constraints have been used to show that the optimizer can deal with multiple variables. The constraint range has been subjectively decided on a lever by lever basis, using thresholds that resulted in outputs which seemed like feasible projections. The reader is encouraged to run the optimizer using their own constraints.

Disclosure statement
No potential conflict of interest was reported by the author(s).

Data availability statement
The data that support the findings of this study are available in Github at "https://jg719.github.io/IRP-acse-jg719-documentation/". These data were derived from the following resources available in the public domain: The Global Calculator (at "http://tool.globalcalculator.org/").