Calcualting deviations (excess heat and excess cold) from an established temperature baseline as area under the temperature curve via integral calculus and expressing such measure as Excess Degree-Days, or EDD.
Characterization of daily air temperature as it relates to human comfort and conditions optimal for survival has many solutions. On the one hand, the mean daily, monthly, and annual air temperatures convey the necessary information with one number. However, as it is the case with many measures of central tendency, mean temperature loses a lot of important information, such as minimum and maximum values, and the range. On the other hand, minimum and maximum values inform the public of the temperature on a given day, but don’t communicate the extremity of said temperature readings well enough. Additionally, both daily min and max values, when aggregated to average minimums and average maximums, become more abstract.
Finally, a measure that is being used more frequently in recent years and is designed to communicate the dangers of climate change is the amount of days with temperature above a certain threshold. For instance, in the articles published in the United States, “days with temperature above 90°F/95°F” is frequently used (Plumer and Popovich 2017) (Climate Impact Lab 2018) (Livingston 2020). Such indicator serves its purpose relatively well, but it loses the complexity of temperature variation and extremes and potentially evens out places with different weather and temperature readings.
On the other hand, there exist indexes and calculations that reflect the weather (and temperature in particular) not in degrees or in days when a certain condition is met, but in degree-hours or degree-days, quantifying the exposure to heat energy over time. While methodologies vary based on the domain and task at hand, the key idea is to present the difference between an established baseline and actual temperature readings as area, and then to quantify that area (Thom 1952).
While a lot of applications of degree-hours and degree-days seem to be focused in pest control (Zalom et al. 1983), forensics (Megyesi, Nawrocki, and Haskell 2005), and vegetation research, some use of such calculations has been applied to humans (Lin et al. 2019). I propose to use this approach as an alternative approach in evaluating the exposure to excess heat and excess cold in excess heat degree-days, excess cold degree days, and total excess degree-days, where the baseline can be set as temperature optimal for human habitation, and the actual temperature curve is presented as a sine and is calculated from minimum and maximum readings for a given day. Then, quantifying excess heat, cold, and total degree-days can be accomplished with integral calculus as finding the area under the curve.
For the purposes of this analysis, several assumptions and simplifications must be made. The daily temperature is assumed to follow a sinusoidal curve from its minimum value to its maximum value and back.
f(θ)=−a⋅cos(bθ)+d=−(tmax−tmin)2⋅cos(π12θ)+tmin+(tmax−tmin)2
The baseline temperature from which the excess degree-days is calculated is assumed at 18°C, which is a mid-point between a slightly colder temperature optimal for sleep, and a slightly warmer temperature optimal for daytime activity. It needs to be pointed out that such baseline is not entirely objective, as there is no agreement on what the optimal temperature for humans is, as well as there is no consideration given to most other parameters that impact the perception of outdoor air temperature: sunlight exposure, wind, precipitation etc.
To sum up, 18°C is the baseline, and any deviation up or down from which will make a human experience of outside temperature less favorable. Along the same lines, any deviation from 18°C up or down will also make humans rely on other advances of civilization: clothing, indoor insulation, heating, air conditioning, more clothing layers, more heating etc. Thus, the higher the excess degree-days reading, the less livable the place is, or the more reliant the place is on things like air conditioning or central heating.
The calculation of Excess Degree-Hours (or EDH for short) for the general case where the temperature curve crosses the baseline two times on a given day can be notated as:
EDH=∫θ10(g(θ)−f(θ))dθ+∫θ2θ1(f(θ)−g(θ))dθ+∫24θ2(g(θ)−f(θ))dθ
where θ is time, f(θ) is our cosine function, g(θ)=18°C (the baseline), and θ1 and θ2 are the times at which the temperature curve crosses the baseline.

The area above the baseline stands for excess heat degree-days, and the area below the baseline - for excess cold degree-days. The sum of absolute values of both hot and cold areas will represent the total excess degree-days.
The cases when the curve stays completely above or below the baseline are special cases that require only one of the three integrals.
To get Excess Degree-Days (EDD), the EDH needs to be divided by 24: EDD=EDH24
To demonstrate the way this measure works, I will use 3 cities - Los Angeles, Miami, Minneapolis - at 2 specific dates: Feb 1 and Jul 1 of 2018.
Given the min and max temperature values for each city for both days, we can model the temperature curves:

We can then proceed with calculating the area under each curve:

Looking more broadly at full year 2018, we can visualize the cumulative excess degree-hours:

This article sets a theoretical basis for further practical applications. It provides another tool in the toolbox of data analysis as it relates to climate change, weather, urban comfort and livability.
My plan is to build on this work in the future, but given the time constraints, this may happen at some time in the future. Until then, I am hoping this approach will be useful to other researchers.
One quick demonstration of the EDD calculation can be done with displaying the EDD for the United States CBSAs. I will use the data from another project I’ve been working on:
cbsafp <chr> | city <fct> | edd_total <dbl> | edd_cold <dbl> | edd_hot <dbl> |
|---|---|---|---|---|
| 25900 | Hilo | 1189.77 | 351.17 | 838.60 |
| 37100 | Oxnard | 1610.07 | 1041.17 | 568.84 |
| 41740 | San Diego | 1797.78 | 882.43 | 915.40 |
| 41500 | Salinas | 1821.09 | 1559.02 | 262.10 |
| 42200 | Santa Maria | 1903.34 | 1495.19 | 408.20 |
| 41860 | San Francisco | 1908.79 | 1413.33 | 495.45 |
| 31080 | Los Angeles | 1952.35 | 914.48 | 1037.89 |
| 41940 | San Jose | 2042.05 | 1239.95 | 802.07 |
| 42100 | Santa Cruz | 2069.51 | 1604.58 | 465.01 |
| 42220 | Santa Rosa | 2142.27 | 1880.60 | 261.64 |
The way these figures are represented spatially can be visualized as follows:


