External Data in Time Series Regression

Editor
3 Min Read


Insights from incorporating external weather data into a time series regression inspired by Meta’s Prophet

Photo by Michał Mancewicz on Unsplash

When I first moved to the UK, I was stunned to see how much people talked about the weather. Coming from the subtropics¹, today’s weather was much the same as yesterday’s — absolutely glorious. And there would be more of the same tomorrow.

Now, whether (pun intended) we like it or not, the effect of environmental conditions ripple through the things we might be interested in predicting: how much ice cream a store should stock ahead of a sunny weekend, household energy usage during a cold snap, the availability of parking at the beach. The list goes on.

And while important, the weather is notoriously difficult to predict accurately — just ask my phone’s weather app. We won’t let this get in the way of things today, as we’ll first take a look at how incorporating weather information into a model can improve performance, before taking a swing at producing future weather estimates in a simple and not-so-simple way.

We’ll be building on previous discussions on time series regression, and as always, we’ll be using real-world data.

We’ll continue down the rabbit hole of predicting UK road traffic accidents, using our bespoke time series framework to incorporate weather data into a time series regression model.

The model itself has been inspired by the workings of Meta’s Prophet model. While this approach does well to capture the underlying trend, seasonality, and holiday effects, model performance can often be improved by the incorporation of additional information.

Importantly — and so often glossed over — is that the external data that is built into a model needs to be available at the point of prediction. That’s fine in many contexts: for example, there’s no reason to expect that an applicant’s credit score won’t be available to a bank considering a mortgage application.

However, there will be cases in which the external data is completely unknown: the weather is a good example of this. This doesn’t mean…

Share this Article
Please enter CoinGecko Free Api Key to get this plugin works.