With so many different brands, formats and channels to engage with, deciding where, when and how to do your grocery shop can be a complex decision. Some of us will do a regular weekly shop at a large superstore, some will do smaller top-up shops throughout the week, and others will use their mobile to order groceries to their home at a designated time.
As strange a question as it may seem, can the idea of gravity be used to account for all these different behaviours?
In this article I summarise some of the findings from my recent Advanced Spatial Analysis PhD Thesis conducted at the Centre for Advanced Spatial Analysis UCL, and in partnership with dunnhumby. I’ll look at the idea of gravity modelling in retailing, and how the model can be used to estimate grocery store sales in the UK.
Gravity is a concept most of us will have been taught at school. You’ll likely recall the story of Isaac Newton sitting under a tree when an apple fell onto his head, leading him to wonder why the apple fell straight down as opposed to sideways or even upwards. This line of questioning eventually led to Newton identifying gravity as a force that holds us on the ground and keeps the moon and planets in their orbits.
This idea was then linked to the movement of individuals by Ernst Georg Ravenstein in the late 1800s, and William J. Reilly was the first to link gravity to retail. Reilly formulated an equation that could be used to determine trade boundaries between different cities based on the idea of gravity. This would be the point at which an individual would be indifferent to visiting city A or city B for shopping, helping retailers and city planners to determine where best to locate retail outlets.
While gravity modelling has been adapted and improved upon since Reilly’s time, the central concept remains fundamentally unchanged: the flow of goods between two locations is proportional to a measure of the size of the origin and destination, and inversely proportional to the distance between them.
In grocery, the key factors at play are the amount of money available to spend from each point of origin, the attractiveness of the store, and the travel time between them.
Most modern implementations of the gravity model in retailing now take the form of the model derived by A. G. Wilson, known as the “origin-constrained” or “retailing” model. This takes advantage of the mathematics of entropy-maximisation from thermodynamics, placing the model on a more robust mathematical footing and allowing for easier calibration.
To calibrate this model, we can use anonymised loyalty card data which shows the total amount spent per origin at each destination within a given timeframe. The calibrated model can then be used to predict total store revenue based on the estimated revenue available from each origin.
Previous applications of gravity models using loyalty card data suggested that they could be highly accurate. At a small spatial scale they could be used to predict store revenue to within +/-10% across a whole year. Our research thus began with attempting to scale these models to predict store revenue for a whole region within the UK, essentially estimating the revenue for over 100 supermarket size stores for each week across a whole year.
The gravity model was thus trained on a dataset of anonymised loyalty card data from a national grocery retailer. This data showed the amount spent per week, per output area (a UK census area with around 150 households), and per store. The calibrated parameters from this model were then used to estimate total store revenue for the whole region, which could then be compared to the actual revenue.
What our results showed, however, was that at this scale the gravity model was unable to account for the variation in store conditions and consumer behaviour to reliably predict actual revenues. While a few stores were well predicted on a consistent basis, the majority were poor enough predictions that the model would unlikely to be used in practice to make new store location decisions.
The next step was to see whether we could replicate the performance seen in previous papers. These papers suggested that a gravity model could be reliably used to estimate grocery store revenue to within +/-10% across a whole year for four stores, and +/-30% for sixteen stores. Perhaps we had just been modelling too many stores all at once.
To make sure that our attempts at replication were consistent, instead of using a single group of either four or sixteen stores, we replicated the model across 47 different groups of each size. These stores were selected from a single region based on stores that were located next to each other, replicating the conditions from the previous papers.
Our results from this analysis showed that while there could have been conditions that led to the performance seen in the previous literature, their results could not be consistently replicated. This was such that while a single group of each size showed results within the previous bounds, the other 46 groups did not.
These results supported the argument from the regional model application that – at this scale, and with the current data and modelling formulation – the gravity model was unable to account for the variance in underlying store characteristics and consumer behaviour at regional scale.
This left two questions: was it the form of the model that was affecting performance, or was it changes in behaviour by consumers that meant that a gravity model was too simple?
To answer the first of those questions, we employed some alternative models. Adaptations here included:
None of these models showed any significant performance improvements, however, leading us to our final line of questioning.
Our results suggested that either an important feature was missing from the model, or that behaviour had fundamentally changed from what it was before. This took us to the issue of the shopping trends that have emerged since the beginning of the 21st Century in the UK such as:
These changes in both consumer and retailer behaviour can be seen to influence interactions within the grocery retailing market. This affects the underlying assumption of the gravity model that shopping would be undertaken on a weekly basis, with consumers travelling by car and with a clearly defined regular basket.
This may mean that for the gravity model to reach levels of accuracy seen before, it would need to adapt or potentially that newer models such as Random Forests, Neural Networks and Agent Based Models (ABMs) need to be used.
This is a highly abridged version of an article that was originally published on Medium.
Make Retail Media work for your business with Customer Data Science
Retail Media solutionsPlan, execute, and measure the impact of omnichannel Retail Media
dunnhumby Sphere - Retail Media PlatformCookie | Description |
---|---|
cli_user_preference | The cookie is set by the GDPR Cookie Consent plugin and is used to store the yes/no selection the consent given for cookie usage. It does not store any personal data. |
cookielawinfo-checkbox-advertisement | Set by the GDPR Cookie Consent plugin, this cookie is used to record the user consent for the cookies in the "Advertisement" category . |
cookielawinfo-checkbox-analytics | Set by the GDPR Cookie Consent plugin, this cookie is used to record the user consent for the cookies in the "Analytics" category . |
cookielawinfo-checkbox-necessary | This cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary". |
CookieLawInfoConsent | The cookie is set by the GDPR Cookie Consent plugin and is used to store the summary of the consent given for cookie usage. It does not store any personal data. |
viewed_cookie_policy | The cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data. |
wsaffinity | Set by the dunnhumby website, that allows all subsequent traffic and requests from an initial client session to be passed to the same server in the pool. Session affinity is also referred to as session persistence, server affinity, server persistence, or server sticky. |
Cookie | Description |
---|---|
wordpress_test_cookie | WordPress cookie to read if cookies can be placed, and lasts for the session. |
wp_lang | This cookie is used to remember the language chosen by the user while browsing. |
Cookie | Description |
---|---|
CONSENT | YouTube sets this cookie via embedded youtube-videos and registers anonymous statistical data. |
fs_cid | Set by FullStory to correlate sessions for diagnostics and session consistency; not always set. |
fs_lua | Set by FullStory to record the time of the user’s last activity, helping manage session timeouts. |
fs_session | Set by FullStory to manage session flow and recording. Not always visible or applicable across all implementations. |
fs_uid | Set by FullStory to uniquely identify a user’s browser. Used for session replay and user analytics. Does not contain personal data directly. |
VISITOR_INFO1_LIVE | Set by YouTube to estimate user bandwidth and improve video quality by adjusting playback speed. |
VISITOR_PRIVACY_METADATA | Set by YouTube to store privacy preferences and metadata related to user consent and settings. |
vuid | Vimeo installs this cookie to collect tracking information by setting a unique ID to embed videos to the website. |
YSC | Set by YouTube to track user sessions and maintain video playback state during a browser session. |
yt-remote-device-id | YouTube sets this cookie to store the video preferences of the user using embedded YouTube video. |
yt.innertube::nextId | This cookie, set by YouTube, registers a unique ID to store data on what videos from YouTube the user has seen. |
yt.innertube::requests | This cookie, set by YouTube, registers a unique ID to store data on what videos from YouTube the user has seen. |
_ga | The _ga cookie, installed by Google Analytics, calculates visitor, session and campaign data and also keeps track of site usage for the site's analytics report. The cookie stores information anonymously and assigns a randomly generated number to recognise unique visitors. |
_ga_* | Set by Google Analytics to persist session state. |
_gid | Installed by Google Analytics, _gid cookie stores information on how visitors use a website, while also creating an analytics report of the website's performance. Some of the data that are collected include the number of visitors, their source, and the pages they visit anonymously. |
_lfa | This cookie is set by the provider Leadfeeder to identify the IP address of devices visiting the website, in order to retarget multiple users routing from the same IP address. |
Cookie | Description |
---|---|
aam_uuid | Set by LinkedIn, for ID sync for Adobe Audience Manager. |
AEC | Set by Google, ‘AEC’ cookies ensure that requests within a browsing session are made by the user, and not by other sites. These cookies prevent malicious sites from acting on behalf of a user without that user’s knowledge. |
AMCVS_14215E3D5995C57C0A495C55%40AdobeOrg | Set by LinkedIn, indicates the start of a session for Adobe Experience Cloud. |
AMCV_14215E3D5995C57C0A495C55%40AdobeOrg | Set by LinkedIn, Unique Identifier for Adobe Experience Cloud. |
AnalyticsSyncHistory | Set by LinkedIn, used to store information about the time a sync with the lms_analytics cookie took place for users in the Designated Countries (which LinkedIn determines as European Union (EU), European Economic Area (EEA), and Switzerland). |
bcookie | LinkedIn sets this cookie from LinkedIn share buttons and ad tags to recognise browser ID. |
bscookie | LinkedIn sets this cookie to store performed actions on the website. |
DV | Set by Google, used for the purpose of targeted advertising, to collect information about how visitors use our site. |
ELOQUA | This cookie is set by Eloqua Marketing Automation Tool. It contains a unique identifier to recognise returning visitors and track their visit data across multiple visits and multiple OpenText Websites. This data is logged in pseudonymised form, unless a visitor provides us with their personal data through creating a profile, such as when signing up for events or for downloading information that is not available to the public. |
gpv_pn | Set by LinkedIn, used to retain and fetch previous page visited in Adobe Analytics. |
lang | Session-based cookie, set by LinkedIn, used to set default locale/language. |
lidc | Set by LinkedIn, used for routing from Share buttons and ad tags. |
lidc | LinkedIn sets the lidc cookie to facilitate data center selection. |
li_gc | Set by LinkedIn to store consent of guests regarding the use of cookies for non-essential purposes. |
li_sugr | Set by LinkedIn, used to make a probabilistic match of a user's identity outside the Designated Countries (which LinkedIn determines as European Union (EU), European Economic Area (EEA), and Switzerland). |
lms_analytics | Set by LinkedIn to identify LinkedIn Members in the Designated Countries (which LinkedIn determines as European Union (EU), European Economic Area (EEA), and Switzerland) for analytics. |
NID | Set by Google, registers a unique ID that identifies a returning user’s device. The ID is used for targeted ads. |
OGP / OGPC | Set by Google, cookie enables the functionality of Google Maps. |
OTZ | Set by Google, used to support Google’s advertising services. This cookie is used by Google Analytics to provide an analysis of website visitors in aggregate. |
s_cc | Set by LinkedIn, used to determine if cookies are enabled for Adobe Analytics. |
s_ips | Set by LinkedIn, tracks percent of page viewed. |
s_plt | Set by LinkedIn, this cookie tracks the time that the previous page took to load. |
s_pltp | Set by LinkedIn, this cookie provides page name value (URL) for use by Adobe Analytics. |
s_ppv | Set by LinkedIn, used by Adobe Analytics to retain and fetch what percentage of a page was viewed. |
s_sq | Set by LinkedIn, used to store information about the previous link that was clicked on by the user by Adobe Analytics. |
s_tp | Set by LinkedIn, this cookie measures a visitor’s scroll activity to see how much of a page they view before moving on to another page. |
s_tslv | Set by LinkedIn, used to retain and fetch time since last visit in Adobe Analytics. |
test_cookie | Set by doubleclick.net (part of Google), the purpose of the cookie is to determine if the users' browser supports cookies. |
U | Set by LinkedIn, Browser Identifier for users outside the Designated Countries (which LinkedIn determines as European Union (EU), European Economic Area (EEA), and Switzerland). |
UserMatchHistory | LinkedIn sets this cookie for LinkedIn Ads ID syncing. |
UserMatchHistory | This cookie is used by LinkedIn Ads to help dunnhumby measure advertising performance. More information can be found in their cookie policy. |
yt-remote-connected-devices | YouTube sets this cookie to store the video preferences of the user using embedded YouTube video. |
_gcl_au | Set by Google Tag Manager to store and track conversion events. It is typically associated with Google Ads, but may be set even if no active ad campaigns are running, especially when GTM is configured with default settings. The cookie helps measure the effectiveness of ad clicks in relation to site actions. |