GLAMbox: A Python toolbox for investigating the association between gaze allocation and decision behaviour

Autoři: Felix Molter aff001;  Armin W. Thomas aff002;  Hauke R. Heekeren aff002;  Peter N. C. Mohr aff001
Působiště autorů: WZB Berlin Social Science Center, Berlin, Germany aff001;  Center for Cognitive Neuroscience Berlin, Freie Universität Berlin, Berlin, Germany aff002;  Department of Education and Psychology, Freie Universität Berlin, Germany aff003;  School of Business and Economics, Freie Universität Berlin, Germany aff004;  Department of Electrical Engineering and Computer Science, Technische Universität Berlin, Berlin, Germany aff005;  Max Planck School of Cognition, Leipzig, Germany aff006
Vyšlo v časopise: PLoS ONE 14(12)
Kategorie: Research Article
doi: 10.1371/journal.pone.0226428


Recent empirical findings have indicated that gaze allocation plays a crucial role in simple decision behaviour. Many of these findings point towards an influence of gaze allocation onto the speed of evidence accumulation in an accumulation-to-bound decision process (resulting in generally higher choice probabilities for items that have been looked at longer). Further, researchers have shown that the strength of the association between gaze and choice behaviour is highly variable between individuals, encouraging future work to study this association on the individual level. However, few decision models exist that enable a straightforward characterization of the gaze-choice association at the individual level, due to the high cost of developing and implementing them. The model space is particularly scarce for choice sets with more than two choice alternatives. Here, we present GLAMbox, a Python-based toolbox that is built upon PyMC3 and allows the easy application of the gaze-weighted linear accumulator model (GLAM) to experimental choice data. The GLAM assumes gaze-dependent evidence accumulation in a linear stochastic race that extends to decision scenarios with many choice alternatives. GLAMbox enables Bayesian parameter estimation of the GLAM for individual, pooled or hierarchical models, provides an easy-to-use interface to predict choice behaviour and visualize choice data, and benefits from all of PyMC3’s Bayesian statistical modeling functionality. Further documentation, resources and the toolbox itself are available at

Klíčová slova:

Data visualization – Decision making – Normal distribution – Prefrontal cortex – Probability distribution – Sensory perception – Simulation and modeling


1. Armel KC, Beaumel A, Rangel A. Biasing simple choices by manipulating relative visual attention. Judgment and Decision Making. 2008;3:396–403.

2. Cavanagh JF, Wiecki TV, Kochar A, Frank MJ. Eye tracking and pupillometry are indicators of dissociable latent decision processes. Journal of Experimental Psychology: General. 2014;143(4):1476–1488. doi: 10.1037/a0035813

3. Fiedler S, Glöckner A. The Dynamics of Decision Making in Risky Choice: An Eye-Tracking Analysis. Frontiers in Psychology. 2012;3. doi: 10.3389/fpsyg.2012.00335

4. Folke T, Jacobsen C, Fleming SM, De Martino B. Explicit representation of confidence informs future value-based decisions. Nature Human Behaviour. 2017;1(1):0002. doi: 10.1038/s41562-016-0002

5. Glöckner A, Herbold AK. An eye-tracking study on information processing in risky decisions: Evidence for compensatory strategies based on automatic processes. Journal of Behavioral Decision Making. 2011;24(1):71–98. doi: 10.1002/bdm.684

6. Konovalov A, Krajbich I. Gaze data reveal distinct choice processes underlying model-based and model-free reinforcement learning. Nature Communications. 2016;7:12438. doi: 10.1038/ncomms12438 27511383

7. Krajbich I, Armel C, Rangel A. Visual fixations and the computation and comparison of value in simple choice. Nature Neuroscience. 2010;13(10):1292–1298. doi: 10.1038/nn.2635 20835253

8. Krajbich I, Rangel A. Multialternative drift-diffusion model predicts the relationship between visual fixations and choice in value-based decisions. Proceedings of the National Academy of Sciences. 2011;108(33):13852–13857. doi: 10.1073/pnas.1101328108

9. Pärnamets P, Johansson P, Hall L, Balkenius C, Spivey MJ, Richardson DC. Biasing moral decisions by exploiting the dynamics of eye gaze. Proceedings of the National Academy of Sciences. 2015;112(13):4170–4175. doi: 10.1073/pnas.1415250112

10. Shimojo S, Simion C, Shimojo E, Scheier C. Gaze bias both reflects and influences preference. Nature Neuroscience. 2003;6(12):1317–1322. doi: 10.1038/nn1150 14608360

11. Stewart N, Gächter S, Noguchi T, Mullett TL. Eye Movements in Strategic Choice. Journal of Behavioral Decision Making. 2016;29(2-3):137–156. doi: 10.1002/bdm.1901 27513881

12. Stewart N, Hermens F, Matthews WJ. Eye Movements in Risky Choice. Journal of Behavioral Decision Making. 2016;29(2-3):116–136. doi: 10.1002/bdm.1854 27522985

13. Vaidya AR, Fellows LK. Testing necessary regional frontal contributions to value assessment and fixation-based updating. Nature Communications. 2015;6: 10120. doi: 10.1038/ncomms10120

14. Tavares G, Perona P, Rangel A. The Attentional Drift Diffusion Model of Simple Perceptual Decision-Making. Frontiers in Neuroscience. 2017;11. doi: 10.3389/fnins.2017.00468 28894413

15. Ashby NJS, Jekel M, Dickert S, Glöckner A. Finding the right fit: A comparison of process assumptions underlying popular drift-diffusion models. Journal of Experimental Psychology: Learning, Memory, and Cognition. 2016;42(12):1982–1993. doi: 10.1037/xlm0000279 27336785

16. Fisher G. An attentional drift diffusion model over binary-attribute choice. Cognition. 2017;168:34–45. doi: 10.1016/j.cognition.2017.06.007 28646751

17. Krajbich I, Lu D, Camerer C, Rangel A. The Attentional Drift-Diffusion Model Extends to Simple Purchasing Decisions. Frontiers in Psychology. 2012;3. doi: 10.3389/fpsyg.2012.00193

18. Lopez-Persem A, Domenech P, Pessiglione M. How prior preferences determine decision-making frames and biases in the human brain. eLife. 2016;5:e20317. doi: 10.7554/eLife.20317 27864918

19. Trueblood JS, Brown SD, Heathcote A, Busemeyer JR. Not Just for Consumers: Context Effects Are Fundamental to Decision Making. Psychological Science. 2013;24(6):901–908. doi: 10.1177/0956797612464241 23610134

20. Smith SM, Krajbich I. Attention and choice across domains. Journal of Experimental Psychology: General. 2018;147(12):1810–1826. doi: 10.1037/xge0000482

21. Thomas AW, Molter F, Krajbich I, Heekeren HR, Mohr PNC. Gaze bias differences capture individual choice behaviour. Nature Human Behaviour. 2019;3(6):625–635. doi: 10.1038/s41562-019-0584-8 30988476

22. Cavanagh SE, Malalasekera WMN, Miranda B, Hunt LT, Kennerley SW. Visual Fixation Patterns during Economic Choice Reflect Covert Valuation Processes That Emerge with Learning. Proceedings of the National Academy of Sciences. 2019; p. 201906662.

23. Gwinn R, Krajbich I. Attitudes and Attention. Journal of Experimental Social Psychology. 2020;86:103892. doi: 10.1016/j.jesp.2019.103892

24. Bogacz R, Brown E, Moehlis J, Holmes P, Cohen JD. The Physics of Optimal Decision Making: A Formal Analysis of Models of Performance in Two-Alternative Forced-Choice Tasks. Psychological review. 2006;113(4):700. doi: 10.1037/0033-295X.113.4.700 17014301

25. Wiecki TV, Sofer I, Frank MJ. HDDM: Hierarchical Bayesian estimation of the Drift-Diffusion Model in Python. Frontiers in Neuroinformatics. 2013;7. doi: 10.3389/fninf.2013.00014 23935581

26. Ratcliff R, Tuerlinckx F. Estimating parameters of the diffusion model: Approaches to dealing with contaminant reaction times and parameter variability. Psychonomic Bulletin & Review. 2002;9(3):438–481. doi: 10.3758/BF03196302

27. Salvatier J, Wiecki TV, Fonnesbeck C. Probabilistic programming in Python using PyMC3. PeerJ Computer Science. 2016;2:e55. doi: 10.7717/peerj-cs.55

28. McKinney W. Data structures for statistical computing in python. In: Proceedings of the 9th Python in Science Conference. vol. 445. Austin, TX; 2010. p. 51–56.

29. Voss A, Voss J. Fast-dm: A free program for efficient diffusion model analysis. Behavior Research Methods. 2007;39(4):767–775. doi: 10.3758/bf03192967 18183889

30. Gamerman D, Lopes HF. Markov Chain Monte Carlo: Stochastic Simulation for Bayesian Inference, Second Edition. Chapman and Hall/CRC; 2006.

31. Gelman A, Shirley K. Inference from Simulations and Monitoring Convergence. In: Handbook of Markov Chain Monte Carlo. Chapman and Hall/CRC; 2011. p. 189–200.

32. Kruschke J. Doing Bayesian data analysis: A tutorial with R, JAGS, and Stan. Academic Press; 2014.

33. Kucukelbir A, Tran D, Ranganath R, Gelman A, Blei DM. Automatic differentiation variational inference. The Journal of Machine Learning Research. 2017;18(1):430–474.

34. Vehtari A, Gelman A, Gabry J. Practical Bayesian model evaluation using leave-one-out cross-validation and WAIC. Statistics and Computing. 2017;27(5):1413–1432. doi: 10.1007/s11222-016-9696-4

35. Lerche V, Voss A, Nagler M. How many trials are required for parameter estimation in diffusion modeling? A comparison of different optimization criteria. Behavior Research Methods. 2017;49(2):513–537. doi: 10.3758/s13428-016-0740-2 27287445

36. Voss A, Nagler M, Lerche V. Diffusion Models in Experimental Psychology. Experimental Psychology. 2013;60(6):385–402. doi: 10.1027/1618-3169/a000218 23895923

37. Ratcliff R, Childers R. Individual Differences and Fitting Methods for the Two-Choice Diffusion Model of Decision Making. Decision (Washington, DC). 2015;2015.

38. Orquin JL, Mueller Loose S. Attention and choice: A review on eye movements in decision making. Acta Psychologica. 2013;144(1):190–206. doi: 10.1016/j.actpsy.2013.06.003 23845447

39. Smith SM, Krajbich I, Webb R. Estimating the dynamic role of attention via random utility. Journal of the Economic Science Association. 2019; p. 1–15.

Článek vyšel v časopise


2019 Číslo 12