The Global Temperature Trend

When we try to pick out anything by itself, we find it hitched to everything else in the universe. (John Muir)

Searing bright flames leaped and engulfed the majestic oak and pine trees, along with anything that was caught in its way, that wildfire, the California Campfire, was one of the most destructive in California’s history of wildfires. Even if you were a few hundred miles away, somewhere in the bay area, you could feel the smoke-filled air scorching your throat and constricting the airways as you inhale.

Although many different factors lead to the back to back wildfires, climate change also has its role to play. But California is no stranger to wildfires then what gives? California’s temperature is on an upward trajectory, which helps enable longer and more intense fire seasons, creates more fuel to burn as vegetation and grasses dry out, these flames are then further carried out at the backs of strong winds, spreading the fires over large areas.

Another incident that grabbed my attention while reading about this subject happened several years earlier, in 2015, and in a different continent, the temperature rose to ~120 degrees Fahrenheit in Pakistan and India, resulting in the loss of thousands of lives. The heatwaves were expected but the intensity and the frequency of such events relate it to the global climate change.

Here, I will be giving an elementary treatment to the global temperature, visualizing the historic trend, and evaluating its relationship with other aspects of the environment.

With the help of scikit's LinearRegression, we will work out that:

  • The average rate of increase in global temperature per decade after 1981 is much higher then what it is since 1880 per decade.
  • Greenhouse gases play a significant role in the increase in temperature.
  • Stratospheric Aerosols have a cooling effect.
  • Visualize other variables such as El Niño, La Niña, and Total Solar Irradiance on the timeline.
  • Create a regression model that includes other climate variables to understand their relationship with the global temperature.

Global Temperature

Following is the plot of GISTEMP showing the actual as well as a rolling average over 10 years periods. GISS Surface Temperature Analysis (GISTEMP) gives us an estimate of the global surface temperature change. It recalculates consistent temperature anomaly series from 1880 to the present. Temperature anomaly is the temperature deviation from the base period which in this case is average over the 30 years from 1951 to 1980.

A few inferences can be made prima facie, looking at the graphs above, the global temperature anomaly is increasing year by year.

We can model this in the following equation:

Global Temperature = 0.0074 * Year + -14.44

Explained variance = 0.74

Let’s see how the residuals look like:

As you can see above the residuals graph are not as random and has some shape like that of W.

Plotting again the trend below, you can see the line before 1981 has more ups and downs.

Therefore, I’m going to divide the timeline into before and after 1981. The following graphs show the residuals for the two divided timelines:

The explained variance for the above two graphs are:

Before 1981 Explained Variance = 0.4282

After 1981 Explained Variance = 0.848859

The explained variance for the timeline after 1981 is higher compared to both before 1981 and the full time-series.

The above two timelines can be modeled as follows:

After 1981 Global Temperature = 0.0194 * Year — 38.320418

Before 1981 Global Temperature = 0.0037* Year — 7.340883

The rate of change of the global temperature after 1981 is 0.1942 degrees centigrade per decade. This approximately matches with the statement at ‘

The following graph shows all the models we created so far on to the original timeline:

Ultimately, for this article we want to create another simple model of the global temperature, taking into account various other climate variables.

The next section intends to introduce these variables that will be used later.

Annual Greenhouse Gas Index (AGGI)

AGGI is a measure of the climate-warming influence of the long-lived greenhouse gases mainly: CO2, Methane, Nitrous Oxide, Chlorofluorocarbons, and other gases.

Let’s review a few concepts before we start using this AGGI index in our model.

Longwave and shortwave radiation: short wave radiation is given off by the Sun and contains more energy compared to the longwave radiation emitted by the Earth.

Going back to the eponymous greenhouse effect, the greenhouse gases allow the Sun’s short wave radiation in, but absorbs the longwave radiation emitted by the Earth and reflects it back into the atmosphere and hence contribute to the warming.

Greenhouse gases are necessary for life on earth but climatologists are concerned about the rising level due to anthropogenic activities. Especially because the rate at which global warming is happening is unprecedented.

AGGI is plotted on the y-axis below, and you can see that Carbon Dioxide is the largest contributor to the index followed by Methane.

Below is the pair-plot of major gases against the AGGI.

Did you notice a reverse hockey stick in the graph for CFC11 and CFC12 above? It looks like AGGI is higher even when the values of those gases are smaller.

Stratospheric Aerosols

Aerosols are any solid or liquid particles suspended in the air. For example, mineral dust, soot, black carbon, volcanic ash, etc. It is produced both naturally e.g sea spray or volcanic eruption, as well as due to human activities, like auto or industrial emission, smoking, and even cooking, and its presence affects us and the environment in numerous ways, such as causing various health hazards and changing both the global and local climate.

While the bulk of the aerosols are due to natural causes, we humans are not relenting in increasing pollutants in the air as well.

Within the atmosphere, the aerosols in the Troposphere are mostly due to vegetation, oceans, and deserts. The Aerosols in the stratosphere build up largely due to volcanic activities and can last a couple of years.

Here, we would specifically be looking at Stratospheric aerosols and how it relates to our investigation of global temperature anomaly over time.

Large explosive volcanoes inject sulfur dioxide into the stratosphere which reacts with the water vapors to form aerosols composed of sulfuric acid particles. This has a cooling effect on the Earth’s surface but not all is good, as always the case with most things, these aerosols are detrimental to the stratospheric ozone.

One measure to quantify aerosols in the atmosphere is Aerosol Optical Depth (AOD) and it relates to the amount of light scattered or absorbed in a column through the atmosphere.

Apropos to the spikes in the above graph, few major volcanic eruptions corresponding to the timeline are:

El Niño Southern Oscillation index

ENSO, the El Niño Southern Oscillation index, describes the linked phenomena of Southern Oscillation and El Niño. Southern Oscillation is the change in air pressure over the tropical Pacific Ocean whereas El Niño is the unusual pattern of warming of surface waters in the eastern tropical Pacific Ocean. When the coastal waters become warmer, the atmospheric pressure above the ocean decreases. Major phases of ENSO are La Niña, Neutral, and El Niño. It is a primary predictor of global climate disruptions.

We’ll be talking about eastern and western regions of the tropics of the Pacific Ocean, and a review is in order, mainly that the eastern Pacific Ocean is actually in the Western Hemisphere, and the western Pacific Ocean, in the Eastern Hemisphere.

In a neutral or normal phase, strong winds blow from east to west over the tropical Pacific Ocean and in the process push the warm surface waters to the western Pacific and allow the cooler waters to rise on the eastern coast such as on the coast of Peru or Ecuador. In this condition, the sea levels and the surface temperatures are higher in the western tropical region. E.g. higher in Indonesia compared to Ecuador and Peru.

In the El Niño event, the trade wind weakens. It allows the warm water to move back towards the east and the thermocline, i.e. the level of ocean depth separating warm surface water from the colder water below, deepens. This prohibits upwelling i.e. rising of the cooler water to the surface, which in turn makes the water warmer and further weakens the trade winds. El Niño generally lasts for less than a year.

La Niña, on the other hand, is the cooling of the tropical western Pacific Ocean. The trade winds blow even stronger, expanding the warm water pool in the western tropical side of the pacific ocean and cooling the eastern i.e the South American side. This causes the temperature difference between the two sides to increase further, causing more water evaporation, clouds, and rains in the tropical western pacific. El Niño can last between one to three years.

Here, I’m using MEI which is Multivariate ENSO Index that combines atmospheric and oceanic variables: Sea Level Pressure (SLP), Sea Surface Temperature (SST), a zonal and meridional component of the surface wind, and outgoing longwave radiation (OLR), over the tropical Pacific basin.

Large positive values indicate the occurrence of El Niño conditions and large negative values of La Niña conditions.

Total Solar Irradiance

Total Solar Irradiance (TSI) measures the amount of radiant energy emitted by the Sun over all the wavelengths each second on a 1 square meter perpendicular plane outside Earth’s atmosphere.

Sun cyclically goes through dark and bright regions over eleven years period and although the primary source of energy on Earth, is not considered the main contributor to global warming.

Considering AGGI, TSI, ENSO, and AOD in Global Temperature Estimations

We can combine the data sets above to form a new data frame. Peaking at the tail shows as follows:

Exploration from now on would be on a scaled and normalized dataset.

We can look at the pair-plots of each explanatory variable against the global temperature anomaly.

Consider the scatter plot of GISTEMP vs AGGI, for higher values of AGGI, there are higher values of GISTEMP. In the plot for GISTEMP vs AOD, more points and especially the higher points are closely huddled around the lower values of AOD. GISTEMP vs TSI, appears to have more points with higher value regardless of the GISTEMP but we do see some points on the left and center with lower GISTEPM.

The plot for ENSO vs GISTEMP looks to be more scattered.

Let’s look at TSI and GISTEMP and notice that there are several gaps where TSI and GISTEMP are diverging. Perhaps we can fill some of the gaps with other variables.

Let’s look at ENSO and GISTEMP and notice the timeline between~1991 to ~1994. It looks starkly opposite of each other and the global temperature is taking a dip.

We know that AOD has a cooling effect and we also know that there a major volcanic eruption of Mount Pinatubo. Plotting it over the previous graph shows a spike around ~1991 to ~1994 which can explain the drop in the global temperature anomaly. Another somewhat similar spike appears to be in the vicinity of ~1982 and also a dip in the temperature.

Below is the graph showing TSI along with the above variables. It looks to me that in some cases where TSI is high but the temperature is low, I could find some other climate events to explain that. E.g. ~1999–2001 has higher TSI but shows a La Niña event.

The period from 2010 onwards is showing the temperature line creeping up. There is an ENSO spike but it seems to be diverging from TSI. Let’ plot AGGI with temperature and ENSO.

The AGGI is also comparably higher 2010 onwards and perhaps contributing to the temperature increase.

Let’s look at the correlation coefficients and the p-values for all the variables.

All three methods are showing a positive correlation with the greenhouse gas index, and a negative correlation with Stratospheric Aerosols. The p-value for these are smaller than 0.5, so I think these correlations are viable.

Total Solar Irradiance (TSI) is also showing a moderate positive correlation with the temperature. ENSO values are not showing any correlation.

I’m not sure why AGGI is showing a strong correlation with AOD in the case of spearman.

Linear Regression model with all the variables

After fitting all combinations of the above variables in the OLS model, I found that the difference between the adjusted R2 of the variable combination that excludes TSI vs the model that takes into account all the variables is very small. It’s also the highest after the all-variable combination.

Adjusted R2 with ‘AGGI’, ‘ENSO’, ‘AOD_GLOBAL’, ‘TSI’ is 0.876

R2 with ‘AGGI’, ‘ENSO’, ‘AOD_GLOBAL’ is 0.869

Fitting TSI along with the rest of the variables gives it a negative co-efficient which doesn’t seem explainable because the temperature shouldn’t decrease with the increase in solar radiance, therefore I decided to drop that feature.

Finally, after fitting the dataset into scikit LinearRegression , the following equation is produced.

Global Temperature = 0.88 * AGGI + 0.22 * ENSO -0.23 * AOD +9.81e-17

R2 Score = 0.879

Adjusted R2 Score = 0.869


As expected, we have a larger coefficient value for AGGI indicating a higher positive effect on the temperature, and the negative co-efficient for AOD, indicating that it has an effect of decreasing the temperature.


[1] Herring, S. C., N. Christidis, A. Hoell, M. P. Hoerling, and P. A. Stott, Eds., 2020: Explaining Extreme Events of 2018 from a
Climate Perspective. Bull. Amer. Meteor. Soc., 101 (1), S1–S128, doi:10.1175/BAMS-ExplainingExtremeEvents2018.1.

[2] Herring, S. C., A. Hoell, M. P. Hoerling, J. P. Kossin, C. J. Schreck III, and P. A. Stott, Eds., 2016: Explaining Extreme Events of
2015 from a Climate Perspective. Bull. Amer. Meteor. Soc., 97 (12), S1–S145.


  • GISTEMP Team, 2020: GISS Surface Temperature Analysis (GISTEMP), version 4. NASA Goddard Institute for Space Studies. Dataset accessed 20YY-MM-DD at
  • Lenssen, N., G. Schmidt, J. Hansen, M. Menne, A. Persin, R. Ruedy, and D. Zyss, 2019: Improvements in the GISTEMP uncertainty model. J. Geophys. Res. Atmos., 124, no. 12, 6307–6326, doi:10.1029/2018JD029522.

[4] AGGI

[5] TSI

[6] Interpreting correlations

[7] ENSO



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store