Data Analysis / Holiday Projects / Statistics & Data Science

WBGT & the relaxation of Tw

In this series of posts we are exploring the relaxation of natural wet bulb temperature (Tw), a necessary step in the modeling of the wet bulb global temperature (WBGT) and physiological heat stress. In our previous post we explored the rate of relaxation which is the limiting step when it comes to the calculation of WBGT at scale. We showed that the rate of relaxation follows an exponential decay and that it is highly dependent on the two input temperatures Ta (atmospheric) and Td (dew point).

Via generalised linear regression we were able to confirm that Td and the relative difference in Ta and Td had a significant effect upon the rate of relaxation. In this post we are going to explore the linear model in more detail. We will see if it is suitable for the accurate prediction of Tw (given Ta and Td), or if not, whether we can use predicted values to provide better starting conditions for the iterative relaxation.

The Algorithm
Recall from our earlier posts, that the calculation of WBGT requires the iterative approximation of Tw. The algorithm takes Ta and Td as inputs. Initially, Tw is set equal to Td and then this is slowly refined. In psuedocode the algorithm looks like this:

calcWBGT(Ta, Td):
    Tw := Td + 0.2
    while not converged:
        check_converged()
        Tw += 0.2
end

Here we have glossed over the details of what check_converged() is, but you can find the full algorithm in our earlier post here. Long story short, the relaxation of Tw described above can often take many hundreds of iterations, which is a significant problem at scale.

Predicting Tw
Previously we used generalised linear regression to explore the effects of Ta and Td on the rate of relaxation. We found that the following model provided a reasonable approximation:

rate \; = \; 3.4 \; - \; 0.025Td \; + \; 0.027diff \; + \; 0.00028Td:diff

where diff is the difference between the two input temperatures (Ta – Td) and Td:diff is the interaction of these two terms. The rate of decay was modeled as count data, assuming a Poisson distribution.

Of course the best case scenario would allow us to accurately predict the rate of decay of Tw and thus, avoid any iteration. However while reasonable within certain temperature ranges, as Td increased the predicted values began to over estimate and skew the results as shown in the figure below:

WBGT calculated using predicted values for Tw was compared with the original algorithm, with significant disagreement particularly at the extreme ends of input temperature Td.

WBGT calculated using predicted values for Tw was compared with the original algorithm, with significant disagreement particularly at the extreme ends of input temperature Td.

We can observe from the plot above that WBGT calculated using predicted Tw agrees with the original algorithm within +/- 10 degrees Celcius. The greatest errors occur where Td is very low (Td < -50 degrees Celcius) e.g. up around the Greenland. There is also increasing errors at the upper ranges of Td, specifically note the colour gradient that runs from the Northern hemisphere (February, i.e. winter month with low Td) down to the Southern hemisphere (summer month with higher Td). Some of this variation will be captured by the confidence intervals, but the disagreement is impractical when considering physiological heat stress where a deviation of as little as 1 degree Celsius is of significant interest.

Estimating Initial Conditions for Tw

So while the linear model is not as accurate as we might like, perhaps we can use it to estimate a better starting point for the relaxation. The core issue with the performance of this algorithm is the sheer number of iterations required. So perhaps we can achieve a quick and effective performance improvement simply by providing a better initial estimate for Tw.

In general, the predicted values for Tw are being over-estimated as shown in the histogram below:

The predicted number of iterations to fully relax Tw is generally over estimated.

The predicted number of iterations to fully relax Tw is generally over estimated.

Despite the observed over estimation, the prediction tends to be reasonably close to the mark such that subtracting a small offset (which we will call delta) should provide an estimate very close to the final stopping conditions. We re-calculated WBGT using a range of values for delta from 1 through to 15. Comparing the mean squared error (actual WBGT c.f. predicted WBGT):

By varying the value of delta from 1 through 15, the mean squared error (actual WBGT - predicted WBGT) was compared. A value of approx. 10 provided an optimal accuracy.

By varying the value of delta from 1 through 15, the mean squared error (actual WBGT – predicted WBGT) was compared. A value of approx. 10 provided an optimal accuracy.

Comparison of the mean squared error revealed an optimal region of between 8 and 10 for the offset. Using an offset of 10, we compared the predicted WBGT with the original WBGT and found near-perfect agreement at all temperature ranges:

The figure above shows exceptional agreement between the observed WBGT and the predicted WBGT. There are two areas where there is disagreement, which are likely due to errors through missing data than errors in the model.

The figure above shows exceptional agreement between the observed WBGT and the predicted WBGT. There are two areas where there is disagreement, which are likely due to errors through missing data than errors in the model.

There are two areas of disagreement in the above plot. We suggest that these most likely coincide with missing data points in the raw data sets.

Comparing the Performance

Using delta = 10, we benchmarked the performance of the original algorithm against the predictive algorithm.

The performance of the original algorithm and predictive algorithm were compared over increasing number of observations. The predictive algorithm was found to dramatically improve the performance at scale.

The performance of the original algorithm and predictive algorithm were compared over increasing number of observations. The predictive algorithm was found to dramatically improve the performance at scale.

The performance of the original algorithm rapidly degrades as the scale of the problem increases. Conversely, the performance of the predictive algorithm (used to optimise the initial estimation of Tw) is dramatically better.

Conclusions

Using the previously determined linear model, we were able to effectively ‘short-circuit’ the number of iterations required to fully relax Tw and thus, dramatically improve the performance at scale. As a quick win this is a great result and if performance was our only goal then this would be a good job.

However, I still think that we should be able to build a better model than this iterative approximation. The relaxation of Tw is a well behaved, continuous exponential function. It is still my hope that we might build a mechanistic model to describe this process and perhaps gain some additional insight into the approximtion of WBGT in the process. In future posts we will explore an algorithm published by Stull (2011) derived through genetic programming as well as possible non-linear models for the relaxation of Tw.

References

Stull, R. (2011). Wet-bulb temperature from relative humidity and air temperature. Journal of Applied Meteorology and climatology, 50(11), 2267-2269.

Advertisements

One thought on “WBGT & the relaxation of Tw

  1. Pingback: Heat Stress Indicators & Climate Change: Exploring the relaxation of Wet Bulb Temperature | adatastory

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s