huff: A Python package for Market Area Analysis
Market area models, such as the Huff model and its extensions, are widely used to estimate regional market shares and customer flows of retail and service locations. Another, now very common, area of application is the analysis of catchment areas, su…
Authors: Thomas Wiel
h uff: A Python pac kage for Mark et Area Analysis Thomas Wieland F reiburg, German y OR CID: 0000-0001-5168-9846 EMail: geo wieland@go oglemail.com 19 F ebruary 2026 Summary Mark et area models, suc h as the Huff mo del and its extensions, are widely used to estimate regional market shares and customer flows of retail and service lo cations. Another, now very common, area of application is the analysis of catc hment areas, supply structures and the accessibility of healthcare lo cations. The huff Python pac kage provides a complete w orkflo w for market area analysis, including data imp ort, construction of origin-destination interaction matrices, basic mo del analysis, parameter estimation from empirical data, calculation of distance or tra vel time indicators, and map visualization. Additionally , the pac kage provides sev eral metho ds of spatial accessibilit y analysis. The pac kage is mo dular and ob ject-orien ted. It is in tended for researchers in economic geography , regional economics, spatial planning, marketing, geoinformation science, and health geograph y . The softw are is op enly av ailable via the Python Pac kage Index (PyPI); its dev elopment and version history are managed in a public GitHub Rep ository and archiv ed at Zeno do. Statemen t of need Mark et area mo dels are used in economic geograph y , regional economics, spatial planning, geoinformation science, and marketing, enabling the analysis and forecasting of mark et areas and customer flows for retail and service lo cations. The classical and most p opular approac h is the Huff mo del (Huff 1962, 1963, 1961) and its numerous deriv ates and extensions, such as the Multiplic ative Comp etitive Inter action (MCI) Mo del (Nakanishi and Co oper 1974, 1982). Typical research applications include examining the influence of store attributes and transport costs on consumer store choice, forecasting the rev enue of new lo cations, or predicting the impact of new lo cations on existing ones (De Beule et al. 2014; Fittkau 2004; Li and Liu 2012; Mensing 2018; Oruc and Tihi 2012; Suárez-V ega et al. 2015; Wieland 2015, 2019). In health geography , such mo dels are used to analyse catchmen t areas with 1 resp ect to medical practices and hospitals (Bai et al. 2023; Fülop et al. 2011; Jia 2016; Latru we et al. 2023; Rhein et al. 2025; Wieland 2018), and they are also increasingly being link ed to metho ds for analyzing the supply structure and accessibilit y of health lo cations (Liu L 2022; Rauch et al. 2023; Subal J 2021). Moreo ver, market area mo dels are also applied to other lo cation-related contexts suc h as airp orts or recreation facilities (W ang et al. 2022; W ang et al. 2026). There are sev eral major c hallenges in mo del-based market area analyses: • The calibration of the Huff mo del based on observed data on consumer b eha vior and/or store sales is difficult b ecause the model is nonlinear in its weigh ting parameters (Huff 2003; Wieland 2017). In this context, the MCI mo del (Nakanishi and Coop er 1974, 1982) has b een developed as an econometric estimation tec hnique based on a linearization ( lo g-c entering tr ansformation ). As this approach requires empirical mark et shares for fitting, it is applied in cases where customer-store interaction data w as obtained by surveys or secondary data (Ba viera-Puig et al. 2016; Latruw e et al. 2023; Oruc and Tihi 2012; Suárez-V ega et al. 2015; Wieland 2015, 2019). Several other researchers dev elop ed and used nonlinear iterativ e fitting approaches, esp ecially when no empirical customer-store interactions are av ailable, but only total sales of the lo cations inv estigated (De Beule et al. 2014; Güßefeldt 2002; GH et al. 1972; Li and Liu 2012; Liang et al. 2020; Mensing 2018; Orpana and Lampinen 2003; Wieland 2017). Due to the pronounced sensitivity of mark et area models to w eighting schemes, the a v ailability of m ultiple calibration approaches is essential in market area analysis. • Researc hers must c ho ose and compare appropriate weigh ting functions, whic h may b e chosen based on theoretical considerations and may result in substan tially differen t results. Now adays, for input v ariables such as trav el time, several w eighting functions (e.g., p o wer, exp onen tial, logistic) are used, and the mo del results are compared using go odness-to-fit metrics (Bai et al. 2023; Latru we et al. 2023; Li and Liu 2012; Orpana and Lampinen 2003). It is, thus, necessary that, within the market area analysis workflo w, sev eral weigh ting functions are av ailable, and that there are options to compare different mo del sp ecifications based on fit metrics. • Calculating trav el times ma y be time consuming because these are based on graph theory net work analysis and require real street netw orks (Huff and McCallum 2008). Therefore, market area analysis t ypically requires GIS (Geographic Information System) supp ort and/or access to an API pro viding calculations based on input origins and destinations. It is ex- tremely helpful for researc hers if they can also complete this part of the mark et area analysis w orkflow within the analysis tool. The huff package for Python v1.8.x essen tially pro vides the follo wing features: • Data management and pr eliminary analysis : Users ma y load customer origins and supply lo cations from p oin t shap efiles (or CSV, XLSX). A t- 2 tributes of customer origins and supply lo cations (v ariables, weigh tings) ma y be set by the user. The next step is to create an inter action matrix with a built-in function, on the basis of whic h all implemen ted models can then b e calculated. Within an interaction matrix, tr ansp ort c osts (distance or trav el time b et ween customer origins and supply lo cations) may b e calculated with built-in metho ds. • Basic Huff mo del analysis : Given an in teraction matrix, users may calculate probabilities and exp ected customer flows with resp ect to customer origins, and total mark et areas of supply lo cations. • Par ameter estimation b ase d on empiric al data : Giv en empirical data on customer flows, regional market shares, or total sales, users may estimate w eighting parameters of market area mo dels. Mo del parametrization ma y b e undergone using the econometric approach in the MCI mo del (if regional mark et shares are av ailable) or by Maxim um Likelihoo d optimization using regional market shares, customer flo ws, or total mark et areas. • A c c essibility analysis : The pac kage includes metho ds of accessibility analy- sis, which may b e combined with market area analysis (esp ecially empirical estimation of w eighting parameters), namely Hansen ac c essibility (Hansen 1959) and Two-step flo ating c atchment ar e a analysis (2SFCA) (Luo and W ang 2003). • GIS to ols : The library also includes auxiliary GIS functions for market area analysis (buffer, distance matrix, ov erlay statistics) and clients for Op enRouteService (Neis and Zipf 2008) and Op enStreetMap (Haklay 2008) for simple maps, with all of them b eing implemented in the mark et area analysis functions but are also able to b e used stand-alone. State of the field T o the b est of our knowledge, no op en-source Python package curren tly provides mark et area analysis and parameter estimation for the Huff or MCI mo del. No op en-source softw are package currently exists that cov ers the entire workflo w of mark et area analyses, as describ ed in the “Statement of need” section. Some but not all of the functionalities mentioned are implemented in R packages: Both the SpatialPosition pac kage (Giraud and Commenges 2025) and the huff-tools pac kage (Pa vlis et al. 2014) pro vide basic Huff Mo del analyses with tw o parameters, calculation of air distances, and map visualization. The R package MCI (Wieland 2017) fo cuses on mo del fitting based on empirical data, but does not provide pro cessing of geospatial data and the calculation of distances or tra vel times. A ccessibility analysis via t wo-step floating catchmen t area analysis is implemen ted in the R package accessibility (P ereira and Herszenh ut 2024). The (almost) complete workflo w for market area analyses using the Huff/MCI mo del is currently only implemen ted in proprietary GIS soft ware, namely the A r cGIS Business A nalyst by ESRI (Esri 2025; Huff and McCallum 2008). 3 Soft ware Architecture The huff pac kage is organized in to a mo dular architecture that separates core mo deling functionality from auxiliary help er mo dules. All model-related classes, metho ds and functions are implemen ted in the models mo dule. Supp orting functionalities are pro vided in separate mo dules, organized thematically . F or example, the ors mo dule pro vides an Op enRouteService client for retrieving tra vel time matrices and iso c hrones, whic h may b e directly accessed from the models mo dule. This design allo ws auxiliary functions to be used indep enden tly of the core models (stand-alone). In order to harmonize the data and outputs while pro cessing, the config mo dule includes configurations for all functions and definitions of default column names, suffixes and prefixes, and mo del terminology . The huff library follo ws an ob ject-orien ted design. The class structure reflects the conceptual actors of a spatial market: Customer demand lo cations are represented b y the CustomerOrigins class and supply lo cations b y the SupplyLocations class. Their connection is established via an in teraction matrix con taining all p ossible origin-destination combinations and the corresp onding data, such as tra vel times and location attributes. It is created from the lo cation data using the built-in function create_interaction_matrix() from the models mo dule, resulting in an instance of the InteractionMatrix class. All implemented mo del analyses ma y b e calculated from an InteractionMatrix ob ject, with the individual steps of the model calculations b eing metho ds of this class, e.g., transport_costs() for adding distances or tra vel times, probabilities() , flows() , and marketareas() for Huff model calculations, or mci_fit() for a MCI mo del analysis. These mo del analyses return ob jects of specific classes for eac h mo del, e.g., HuffModel and MCIModel for Huff and MCI mo dels, resp ectiv ely . All mentioned classes include summary() , show_log() , and, in relev ant cases, plot() metho ds. This structure was chosen to ensure a consisten t w orkflow and a unified data structure, regardless of which mo del analysis is to b e performed. The typical w orkflow for a basic Huff analysis (without empirical parameter estimation) consists of the following steps: (1) Load geospatial data of customer origins and supply locations, (2) Define their attributes and w eightings, (3) Create an in teraction matrix from origins and destinations, including the calculation of distances or trav el time, (4) Calculate regional mark et shares, exp ected customer flo ws, and total mark et areas of all supply locations (This workflo w is shown in the Examples section of the pac kage README.MD). Adv anced mo del analyses (e.g., including empirical calibration) require further steps (See the examples folder in the corresp onding GitHub repository). Researc h impact statemen t The huff pac kage is currently used in a health geography pro ject at the W uerzburg universit y hospital whic h deals with the catchmen t areas of pe- diatric oncology care; a pap er on this topic is currently in the review pro cess. Giv en the rising num b er of scientific studies using market area mo dels - particu- 4 larly for non-retail purp oses suc h as health geograph y - and the widespread use of Python as a programming language, it is to b e exp ected that the huff library will see frequen t adoption in related researc h pro jects. Soft ware developmen t history statemen t Due to data confidentialit y requiremen ts, the early developmen t of the huff library to ok place in a priv ate repository; the public rep ository was initialized more recently to provide op en access for repro ducibilit y and review. The huff Python package has b een publicly developed and published via the [Python P ackage Index] (h ttps://pypi.org/project/huff/) since April 2025. As of submis- sion, it has undergone 41 releases, showing con tinuous improv emen t and feature additions. The library is actively used: since its first release (version 1.0.0) in April 2025, it has b een downloaded approximately 21,900 times from the Python P ackage Index (source: p ep y .tech, accessed F ebruary 14, 2026). AI usage disclosure No AI tools w ere used for soft ware design, implemen tation, or decision-making. The Contin ue agen t in Microsoft Visual Studio Co de (with mo del GPT-5 mini) w as used to generate initial do cstrings, which were subsequently reviewed and adapted by the author. The man uscript text was written without the use of AI to ols. References Bai, Lingyao, Zh uolin T ao, Y ang Cheng, Ling F eng, and Shaosh uai W ang. 2023. “Delineating hierarc hical obstetric hospital service areas using the Huff model based on medical records. ” A pplie d Ge o gr aphy 153: 102903. h ttps://doi.org/https://doi.org/10.1016/j.apgeog.2023.102903. Ba viera-Puig, Amparo, Juan Buitrago-V era, and Carmen Escriba-Perez. 2016. “Geomark eting models in sup ermarket lo cation strategies. ” Journal of Busi- ness Ec onomics and Management 17 (6): 1205–21. h ttps://doi.org/ht tp: //dx.doi.org /10.3846/16111699.2015.1113198. De Beule, Matthias, Dirk V an den P o el, and Nico V an de W eghe. 2014. “An Extended Huff-Mo del for Robustly Benchmarking and Predicting Retail Net work Performance. ” A pplie d Ge o gr aphy 46: 80–89. h ttps://doi.org/https: //doi.org/10.1016/j.apgeog.2013.09.026. Esri. 2025. A r cGIS Business A nalyst . Released. htt ps :// ww w. es ri. co m/ en- us/arcgis/pro ducts/arcgis- business- analyst/overview. Fittkau, Dirk. 2004. “Beeinflussung regionaler Kaufkraftströme durch den A utobahnlück enschluß der A 49 Kassel-Gießen - Zur empirisc hen Relev anz der New Economic Geography in wirtschaftsgeographisc hen F ragestellun- gen. ” Dissertation, Rheinisch-W estfälisc he T echnisc he Ho c hsch ule Aachen. h ttps://doi.org/http://dx.doi.org/10.53846/goediss- 3024. 5 Fülop, Gerhard, Pascal Kopetsch, and Christian Schöpe. 2011. “Catc hment areas of medical practices and the role pla yed by geographical distance in the patien t’s c hoice of do ctor. ” The A nnals of R e gional Scienc e 46 (3): 691–706. h ttps://doi.org/https://doi.org/10.1007/s00168- 009- 0347- y. GH, Haines Jr, Simon LS, and Alexis M. 1972. “Maximum Lik eliho o d Estimation of Central-Cit y F o od T rading Areas. ” Journal of Marketing R ese ar ch 9: 154– 59. https://doi.org/h ttps://doi.org/10.2307/3149948. Giraud, Timothée, and Hadrien Commenges. 2025. Sp atialPosition: Sp atial Position Mo dels . Released. https://doi.org/10.32614/CRAN.package.Spatia lPosition. Güßefeldt, Jörg. 2002. “Zur Modellierung v on räumlic hen Kaufkraftströmen in un vollk ommenen Märkten. ” ERDKUNDE 56 (4): 351–70. https://doi.org/ 10.3112/erdkunde.2002.04.02. Hakla y , Mordechai. 2008. “OpenStreetMap: User-Generated Street Maps. ” IEEE Pervasive Computing 7 (4): 12–18. https://doi.org/10.1109/MPR V.2 008.80. Hansen, W alter G. 1959. “How Accessibilit y Shap es Land Use. ” Journal of the A meric an Institute of Planners 25 (2): 73–76. https://doi.org/10.1080/0194 4365908978307. Huff, David L. 1961. “Defining and estimating a trading area. ” L and Ec onomics 28 (4): 34–38. https://doi.org/h ttps://doi.org/10.2307/1249154. Huff, Da vid L. 1962. Determination of Intr a-Urb an R etail T r ade A r e as . Real Estate Researc h Program, Graduate Schools of Business Administration, Univ ersity of California. Huff, David L. 1963. “A Probabilistic Analysis of Shopping Center T rade Areas. ” L and Ec onomics 39 (1): 81–90. https://doi.org/h ttps://doi.org/10.2307/31 44521. Huff, David L. 2003. “P arameter Estimation in the Huff Mo del. ” A r cU ser 6: 34–36. Huff, David L., and Bradley McCallum. 2008. Calibr ating the Huff Mo del U sing A r cGIS Business A nalyst . ESRI White P ap er, September 2008. ESRI. Jia, Peng. 2016. “Dev eloping a Flow-Based Spatial Algorithm to Delineate Hospital Service Areas. ” A pplie d Ge o gr aphy 75: 137–43. https://doi.org/h t tps://doi.org/10.1016/j.apgeog.2016.08.008. 6 Latru we, T, M V an der W ee, P V anleenhov e, K Michielsen, S V erbrugge, and D Colle. 2023. “Improving inpatient and daycare admission estimates with gra vity mo dels. ” He alth Servic es and Outc omes R ese ar ch Metho dolo gy 23 (4): 452–67. https://doi.org/h ttps://doi.org/10.1007/s10742- 022- 00298- 4. Li, Yingru, and Lin Liu. 2012. “Assessing the Impact of Retail Lo cation on Store Performance: A Comparison of W al-Mart and Kmart Stores in Cincinnati. ” A pplie d Ge o gr aphy 32 (2): 591–600. h ttps://doi.org/ht t p s : //doi.org/10.1016/j.apgeog.2011.07.006. Liang, Y unlei, Song Gao, Y uxin Cai, Natasha Zhang F outz, and Lei W u. 2020. “Calibrating the dynamic Huff model for business analysis using lo cation big data. ” T r ansactions in GIS 24 (3): 681–703. https://doi.org/ht tp s : //doi.org/10.1111/tgis.12624. Liu L, Zhao Y, Lyu H. 2022. “An Impro ved T wo-Step Floating Catchmen t Area (2SF CA) Metho d for Measuring Spatial Accessibilit y to Elderly Care F acilities in Xi’an, China. ” International Journal of Envir onmental R ese ar ch and Public He alth 19: 11465. https://doi.org/h ttps://doi.org/10.3390/ijerph191811465. Luo, W ei, and F ahui W ang. 2003. “Measures of Spatial Accessibilit y to Health Care in a GIS Environmen t: Synthesis and a Case Study in the Chicago Region. ” Envir onment and Planning B: Planning and Design 30 (6): 865–84. h ttps://doi.org/10.1068/b29120. Mensing, Matthias. 2018. “Lebensmittel-Onlinehandel - Alternativ e Zur Zukünftigen V ersorgung Der Bev ölkerung Ländlic her Räume?” Dissertation, Rheinisc h-W estfälische T echnisc he Ho c hsc hule Aachen. h ttps://doi.org/10.18154/R WTH- 2019- 02683. Nakanishi, Masao, and Lee G. Co op er. 1974. “P arameter estimation for a Multiplicativ e Comp etitiv e In teraction Model: Least squares approac h. ” Journal of Marketing R ese ar ch 11 (3): 303–11. h ttps://doi.org/h t t p s : //doi.org/10.2307/3151146. Nakanishi, Masao, and Lee G. Co op er. 1982. “T echnical Note — Simplified Estimation Pro cedures for MCI Mo dels. ” Marketing Scienc e 1 (3): 314–22. h ttps://doi.org/https://doi.org/10.1287/mksc.1.3.314. Neis, Pascal, and Alexander Zipf. 2008. “Op enRouteService.org Is Three Times "Op en": Combining Op enSource, Op enLS and Op enStreetMap. ” GIS R ese ar ch UK Confer enc e (GISR UK 2008) . Orpana, T ommi, and Jouko Lampinen. 2003. “Building Spatial Choice Mod- els from Aggregate Data. ” Journal of R e gional Scienc e 43 (2): 319–48. h ttps://doi.org/https://doi.org/10.1111/1467- 9787.00301. 7 Oruc, Nermin, and Boris Tihi. 2012. “Comp etitiv e Lo cation Assessment – the MCI Approach. ” South East Eur op e an Journal of Ec onomics and Business 7 (2): 35–49. https://doi.org/10.2478/v10033- 012- 0013- 7. P avlis, Michail, Les Dolega, and Alex Singleton. 2014. Huff-T o ols . Released. h ttps://github.com /alexsingleton/Huf f- T ool s/. P ereira, Rafael H. M., and Daniel Herszenh ut. 2024. A c c essibility: T r ansp ort A c c essibility Me asur es . Released. h ttps://doi.org/10.32614/CRAN.pa c k age. accessibility. Rauc h, S., S. Stangl, T. Haas, J. Rauh, and P . U. Heuschmann. 2023. “Spa- tial Inequalities in Prev entiv e Breast Cancer Care: A Comparison of Dif- feren t Accessibilit y Approaches for Preven tion F acilities in Bav aria, Ger- man y . ” Journal of T r ansp ort & He alth 29: 101567. https://doi.org/h tt ps: //doi.org/10.1016/j.jth.2023.101567. Rhein, M von, J Hauser, L Haldimann, R Jörg, and O. Gruebner. 2025. “Im bal- anced access to p ediatric primary care in Switzerland: geographic differences and mo deled future challenges. ” Eur op e an Journal of Pe diatrics 184: 648. h ttps://doi.org/https://doi.org/10.1007/s00431- 025- 06441- w. Suárez-V ega, Rafael, José Luis Gutiérrez-Acuña, and Manuel Ro dríguez-Díaz. 2015. “Lo cating a supermarket using a lo cally calibrated Huff mo del. ” In- ternational Journal of Ge o gr aphic al Information Scienc e 29 (2): 217–33. h ttps://doi.org/10.1080/13658816.2014.958154. Subal J, Krisp JM, Paal P . 2021. “Quantifying spatial accessibilit y of general practitioners by applying a mo dified huff three-step floating catchmen t area (MH3SF CA) metho d. ” International Journal of He alth Ge o gr aphics 20: 9. h ttps://doi.org/https://doi.org/10.1186/s12942- 021- 00263- 3. W ang, Huimin, Xiao jian W ei, and W eixuan A o. 2022. “Assessing Park Accessi- bilit y Based on a Dynamic Huff T wo-Step Floating Catc hment Area Method and Map Service API. ” ISPRS International Journal of Ge o-Information 11 (7). https://doi.org/10.3390/ijgi11070394. W ang, Y ao, Liushan Lin, Xiao dong Meng, Meilin Zhu, and Changcheng Kan. 2026. “Measuring airport catchmen t areas via the Huff gravit y mo del cali- brated with mobile lo cation data—Evidence from the Y angtze River Delta region. ” Journal of T r ansp ort Ge o gr aphy 131: 104552. https://doi.org/h ttps: //doi.org/10.1016/j.jtrangeo.2026.104552. Wieland, Thomas. 2015. R äumliches Einkaufsverhalten Und Standortp olitik Im Einzelhandel Unter Berücksichtigung von A gglomer ationseffekten - The o- r etische Erklärungsansätze, Mo del lanalytische Zugänge Und Eine Empirisch- 8 Ökonometrische Marktgebietsanalyse A nhand Eines F al lb eispiels A us Dem L änd lichen R aum Ostwestfalens/Südnie dersachsens . MetaGIS. Wieland, Thomas. 2017. “Mark et Area Analysis for Retail and Service Lo cations with MCI. ” The R Journal 9: 298–323. https://doi.org/10.32614/RJ- 2017- 020. Wieland, Thomas. 2018. “Modellgestützte V erfahren und "big (spatial) data" in der regionalen V ersorgungsforsch ung II: Räumlic he Interaktionsmodelle. ” Monitor V ersor gungsforschung 11 (3): 59–64. https://doi.org/10.24945/M VF.03.18.1866- 0533.2083. Wieland, Thomas. 2019. “Comp etitive lo cations of grocery stores in the local supply context - The case of the urban district F reiburg-Haslach. ” Eur op e an Journal of Ge o gr aphy 9 (3): 89–115. h ttps://ww w.eurogeojourn al.eu/index. php/egj/article/view /41. 9
Original Paper
Loading high-quality paper...
Comments & Academic Discussion
Loading comments...
Leave a Comment