4

Modeling Climate Change With Python

 3 years ago
source link: https://towardsdatascience.com/modeling-climate-change-with-python-fe8c38b617d6
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Modeling Climate Change With Python

Image for post
Image for post
Source: https://unsplash.com/photos/1qIsv86S79E

Climate change is one of those critical issues that don’t receive enough attention from the AI community. The main reason why machine learning developers and data scientists are building so few climate models is that climate change is painfully hard to forecast in the long run.

While weather forecasts are increasing their accuracy every year, climate predictions and their socioeconomic impact are much harder to estimate, this is due to the huge amount of human variables that play a role in climate change.

However, climatic models have experienced a boost in recent years thanks to Integrated Assessment Models.

Integrated assessment models (IAMs) help us understand how human development and societal choices affect each other and the natural world, they are “integrated” because they combine different disciplines to model human society alongside parts of the Earth system.

There are two main types — simple and complex IAMs:

  • Simple IAMs: models that compare the costs and benefits of avoiding different levels of warming. They are often used to calculate the “social cost of carbon”, a measure of the quantifiable costs and benefits of emitting one additional tonne of CO2 in monetary terms.
  • Complex IAMs: models that deal with energy technologies, energy use choices, land-use changes, and societal trends that cause — or prevent — greenhouse gas emissions. They do this using linked “modules” representing the global economy, as well as its energy, land, and climate systems.

Some IAMs started life as economic models, while other IAMs developed from energy models, matching supply and demand for energy based on detailed representations of different fuels and technologies. Yet others were designed from the start to address environmental problems, modeling the Earth’s land system down to grid-scale.

This enormous variety is what has prevented developers to advance at a fast pace in the field of AIM, as they need expertise in a wide range of subjects.

OK, so now that you have a clearer picture of IAMs, it’s time to jump in and build some simulations.

I am using Python as my language of choice because of its great community and widespread use. You can find a great Python module for the DICE model on this repo.

The most common variables studied in climate change models are CO2 emissions and temperature increase, so for example we can use DICE to plot their relationship in the period of time from 2000 to 2200 just like this:

This code just allowed us to create an array for our time period with the function make_datetime and then looped through the said time frame applying the accumulated temperature and emissions functions.

The graphic obtained looks like this:

Image for post
Image for post
Temperature increase vs CO2 Emissions without taxes

This was for a baseline scenario with no carbon taxes in place, if we want to assess the effect of carbon taxes we only need to update the code before with some values for the taxes, for instance:

Then the graph changes showing the impact of this measure:

Image for post
Image for post
Temperature increase vs CO2 Emissions with taxes

Also, this module will allow us to compare different tax scenarios in a single plot just by doing a one-liner:

Which returns this graph:

Image for post
Image for post
Different tax scenarios comparison

Looks nice right? Well, the truth is the DICE model can reply to many more “What if” questions than we can cover here, but hopefully, at this point, you feel curious enough to play a bit with the DICE model.

In fact, we need a lot of effort to try and take the DICE model from simple to complex, thus being able to output feedback currently missing from almost all complex IAM research.

By far, the most important issue that is not covered yet in complex IAM is that they don’t measure economic damages and reduced growth due to impacts caused by climate change.

There are many catastrophes like hurricanes, floods, or droughts that are now considered black swans which will are likely to become more common due to climate change. We need risk assessment incorporated in our IAM in order to decide what likelihood we are getting exposed to and decide if such a risk is acceptable.

When risks are not acceptable, like the case of Amsterdam being swallowed by a rising sea level scenario, we need to take action and the economic costs of those actions are not evaluated yet. Adding these climate feedbacks to the complex IAMs is “one of the big frontiers” for the modeling community.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK