Appendix C — Efficient Bayesian observer model of hysteresis and adaptation
C.1 R packages used
As indicated in the Methods section, for all our analyses we used R (Version 4.0.4; R Core Team, 2021) and the R-packages BayesFactor (Version 0.9.12.4.2; Morey & Rouder, 2018), brms (Version 2.16.1; Bürkner, 2017, 2018, 2021), coda (Version 0.19.4; Plummer et al., 2006), cowplot (Version 1.1.1; Wilke, 2020), devtools (Version 2.4.4; Wickham, Hester, et al., 2021), doParallel (Version 1.0.17; Corporation & Weston, 2020), dplyr (Version 1.0.10; Wickham, François, et al., 2022), ellipse (Version 0.4.2; Murdoch & Chow, 2020), forcats (Version 0.5.2; Wickham, 2022), foreach (Version 1.5.2; Microsoft & Weston, 2020), GGally (Version 2.1.2; Schloerke et al., 2021), ggdist (Version 3.0.0; Kay, 2021a), ggforce (Version 0.3.3; Pedersen, 2021), ggnewscale (Version 0.4.8; Campitelli, 2022), ggplot2 (Version 3.3.6; Wickham, 2016), ggstance (Version 0.3.5; Henry et al., 2020), glue (Version 1.6.2; Hester & Bryan, 2022), gmm (Version 1.7; Chaussé, 2010), here (Version 1.0.1; Müller, 2020), iterators (Version 1.0.14; Analytics & Weston, 2020), kableExtra (Version 1.3.4; Zhu, 2021), knitr (Version 1.39; Xie, 2015), lubridate (Version 1.8.0; Grolemund & Wickham, 2011), MASS (Version 7.3.53; Venables & Ripley, 2002), Matrix (Version 1.3.2; Bates & Maechler, 2021), mvtnorm (Version 1.1.3; Genz & Bretz, 2009; Wilhelm & G, 2022), papaja (Version 0.1.1; Aust & Barth, 2022), patchwork (Version 1.1.2; Pedersen, 2022), purrr (Version 0.3.4; Henry & Wickham, 2020), Rcpp (Eddelbuettel & Balamuta, 2018; Version 1.0.9; Eddelbuettel & François, 2011), readr (Version 2.1.2; Wickham, Hester, et al., 2022), rstan (Version 2.21.2; Stan Development Team, 2020a), sandwich (Zeileis, 2004, 2006; Version 3.0.2; Zeileis et al., 2020), StanHeaders (Version 2.21.0.7; Stan Development Team, 2020b), stringr (Version 1.4.0; Wickham, 2019), tibble (Version 3.1.8; Müller & Wickham, 2022), tidybayes (Version 3.0.1; Kay, 2021b), tidyr (Version 1.2.1; Wickham & Girlich, 2022), tidyverse (Version 1.3.2; Wickham et al., 2019), tinylabels (Version 0.2.3; Barth, 2022), tmvtnorm (Version 1.5; Wilhelm & G, 2022), truncnorm (Mersmann et al., 2018), and usethis (Version 2.1.6; Wickham, Bryan, et al., 2021).
C.2 Visualization of prior, likelihood, and posterior distributions for one trial
Figure C.1 visualizes the prior, likelihood, and posterior distributions for the first lattice in a single trial of the dot lattices paradigm, given a model with a prior stimulus distribution incorporating the more frequent occurrence of cardinal compared to oblique orientations. Figure C.2 visualizes the prior, likelihood, and posterior distributions for the second lattice in a single trial of the dot lattices paradigm, given the same natural stimulus distribution for the prior of the first lattice.
C.4 Supplementary information concerning Bayesian analyses of interindividual variation in simulation data
We estimated individual hysteresis and adaptation effects using a Bayesian multilevel binomial regression model predicting the percept of the second lattice, with aspect ratio of the first lattice (
The model for the first lattice included fixed and individual random effects for aspect ratio AR (i.e., proximity effect), and individual random intercepts. This model can be formulated as follows:
The model for the second lattice thus included fixed and individual random effects for percept in the first lattice R10 (i.e., hysteresis effect) as well as aspect ratio in the first lattice AR (i.e., adaptation effect), and individual random intercepts. This model can be formulated as follows:
In both the model for the first and for the second lattice, centered aspect ratio was used, which means that a value of zero corresponds to an aspect ratio of 1, a value of 1.1-1 -1 (i.e.,
Figure C.5 visualizes the priors we specified for the fixed effects, for the standard deviation of the random effects, and for the correlation matrix.
We fitted these models of perceived L1 and perceived L2 orientation using brms (Bürkner, 2017, 2018). We used 4 chains with 20000 iterations each with the default number of warmup iterations per chain. For any other sampling specifications we used the default settings. For further details on these analyses and those for calculating the correlation between individuals’ proximity, hysteresis, and adaptation estimates, please consult Van Geert et al. (2022).
C.5 Supplementary Figure concerning interindividual variation in proximity, hysteresis, and adaptation
Figure C.6 visualizes the correlation of estimated individual hysteresis and adaptation effects concerning the second lattice with estimated individual proximity effects concerning the first lattice for the empirical data collected in Van Geert et al. (2022) and for the simulation results.
C.6 Shiny application
Figure C.7 shows the Shiny application to visualize the prior, likelihood, and posterior distributions for one trial under different parameter settings.