Huff Model
Estimate how customers at each origin distribute purchases among the stores in their choice set.
Store choice probabilities
For a customer at origin i, the Huff model divides store j’s attractiveness adjusted for distance by the sum across eligible stores.
In this example, A is store size and D is distance. The exponent α controls the importance of size. A larger positive β discounts distant stores more sharply.
Review Reading Regressions for help interpreting the coefficients.
Fit size and distance weights
This example trains on trips with exactly two available stores. Provide one row per trip in paired_store_choices with chosen_a (0 or 1), size_a, size_b, distance_a_km, and distance_b_km. The log odds of choosing A over B are the differences in their log utilities. The fitted size coefficient is α and the negative of the distance coefficient is β.
Predict shares with the fitted weights
The prediction query expects one row per eligible origin–store pair in store_choice_inputs, with origin_id, store_id, square_footage, distance_km, and spend_potential. Use the same distance measure and units in both queries. Straight-line distance and driving time measure different things and call for separate fits. The 0.1 km floor keeps coincident points finite.
Validate the coefficients and predicted shares on held-out trips. Applying a two-store fit to larger choice sets assumes the same utilities and that relative odds for two stores stay stable when alternatives are added. Expected spend also assumes the input spend is allocated among the listed stores.
Interactive Huff simulator
All values below are computed live using the Huff formula from the Model and Formula tab. Adjust stores, distances, and parameters to see market shares and revenue predictions update in real time.
Model parameters
Stores
| Store | Sq Ft |
|---|---|
| Our Store (104) | |
| Competitor A | |
| Competitor B |
Distance matrix (km) & spend potential
Enter straight-line distance from each zip code to each store. All fields are editable.
| Zip | Spend ($k) | → Store 104 | → Comp A | → Comp B |
|---|---|---|---|---|
| 90210 | ||||
| 90211 | ||||
| 90212 | ||||
| 90213 | ||||
| 90214 |
Computed results
ZIP code probability breakdown
| Zip | Spend ($k) | P(Store 104) | P(Comp A) | P(Comp B) | Rev → 104 |
|---|
Pij = (Sizejα / Distijβ) ÷ Σk(Sizekα / Distikβ) | Revenueij = Pij × Spendi