In multistable dot lattices, the orientation we perceive is attracted toward the orientation we perceived in the immediately preceding stimulus and repelled from the orientation for which most evidence was present previously (Van Geert, Moors, Haaf, & Wagemans, 2022). Theoretically-inspired models have been proposed to explain the co-occurrence of attractive and repulsive context effects in multistable dot lattice tasks, but these models artificially induced an influence of the previous trial on the current one without detailing the process underlying such an influence (Gepshtein & Kubovy, 2005; Schwiedrzik et al., 2014). We conducted a simulation study to test whether the observed attractive and repulsive context effects could be explained with an efficient Bayesian observer model (Wei & Stocker, 2015). This model assumes variable encoding precision of orientations in line with their frequency of occurrence (i.e., efficient encoding) and takes the dissimilarity between stimulus space and sensory space into account. An efficient Bayesian observer model including both a stimulus and a perceptual level was needed to explain the co-occurrence of both attractive and repulsive temporal context effects. Furthermore, this model could reproduce the empirically observed strong positive correlation between individuals’ attractive and repulsive effects (Van Geert et al., 2022), by assuming a positive correlation between temporal integration constants at the stimulus and the perceptual level. To conclude, the study brings evidence that efficient encoding and likelihood repulsion on the stimulus level can explain the repulsive context effect, whereas perceptual prior attraction can explain the attractive temporal context effect when perceiving multistable dot lattices.

*r*= 0.68 (95% highest density continuous interval [HDCI], 0.54–0.79; cf. Figure 10a). We therefore hypothesize that both effects stem from separate but related mechanisms, and in this simulation study an efficient Bayesian observer model is put forward to model the processes underlying both context effects in a theoretically coherent way.

*stimulus history*(i.e., the frequency of occurrence of different stimulus orientations) on the stimulus-to-sensory mapping and consequently the likelihood distribution. In contrast to earlier efficient Bayesian observer models, however, we will argue that it is the

*perceptual history*(i.e., the frequency of occurrence of different perceived orientations) rather than the stimulus history that determines the prior distribution. Different from the implementation by Fritsche et al. (2020), the model will distinguish attractive influences of the previous percept and repulsive influences of the previous stimulus evidence. Given that a mask was present in the dot lattice paradigm to avoid longer-term context effects, we only take the previous lattice into account and do not model longer-term context influences (different from what was the case in Fritsche et al., 2020). Furthermore, the dot lattice paradigm concerns multistable stimuli resulting in multi-peaked likelihood distributions, whereas previous implementations of the efficient Bayesian observer model focused on non-ambiguous stimuli (e.g., Fritsche et al., 2020; Wei & Stocker, 2015). In sum, our model builds on earlier models, but makes at least three innovative contributions.

^{1}All code related to this paper is openly available on the Open Science Framework: https://doi.org/10.17605/OSF.IO/48ESD.

*hierarchical*. The size of the adaptation effect will depend on the relative amount of stimulus noise and sensory noise present, but the size of both context effects will depend mostly on the weights given to the stimulus evidence and percept in the previous trial compared to the long-term context.

_{stimL1}. The internal sensory noise (symmetric in sensory space) is expected to follow a von Mises (i.e., circular normal) distribution on the 180° (i.e., half-circular) orientation space with its mean at the sensory measurement for the actual stimulus orientation in question (based on the stimulus-to-sensory mapping, derived from the cumulative density function for the prior distribution) and its precision being equal to κ

_{sensL1}. The described stimulus and sensory noise are jointly reflected in the noise of the observer’s representation of the stimulus orientation. The observer’s representation of the stimulus orientation (subject to the stimulus noise and sensory noise described earlier in this article) is expected to be bimodal, with peaks at the relative 0° and the relative 90° orientation.

^{2}The relative height of the peaks at the relative 0° and the relative 90° orientation will depend on the AR of the stimulus and the observer’s sensitivity for AR. This bimodal distribution represents the likelihood, and is combined with the prior distribution (either uniform in stimulus space or with peaks at the cardinal orientations) to compute the posterior distribution for the first lattice. From the posterior distribution, either a relative 0° or a relative 90° percept can be sampled with the probabilities depending on the relative probability of perceiving one versus the other orientation.

*c*

_{0}is a normalization constant and θ ∈ [0, π) (cf. Supplementary Figure 1a). This natural stimulus distribution reflects the fact that horizontal and vertical orientations are more common in the natural environment than oblique orientations. On the other hand, within the dot lattice paradigm the long-term stimulus distribution is uniform: every absolute lattice orientation occurs equally frequently. Therefore, we implemented a second variant of the model, with a uniform prior distribution for the first lattice:

*p*(

*m*

_{0}|θ) being the single-peaked likelihood of the sensory measurement for the relative 0° orientation,

*p*(

*m*

_{90}|θ) being the single-peaked likelihood of the sensory measurement for the relative 90° orientation, and

*w*

_{AR}being equal to \(AR^{c\_stim}\). The size of the AR effect on the relative height of the 0° and 90° peaks is thus determined by a constant (i.e.,

*c*

_{stim}), representing the observer’s sensitivity to AR.

*m*is modeled as

_{stim}representing the stimulus noise (added in stimulus space), δ

_{sens}the sensory noise (added in sensory space), θ being the absolute orientation of the stimulus, and the transformation

*F*being the cumulative distribution of the prior

*p*(θ), which determines the stimulus-to-sensory mapping (Wei & Stocker, 2015). For each stimulus orientation θ

_{i},

*p*(

*m*|θ

_{i}) can be computed according to (4) and the specific noise distributions. Both single-peaked likelihood functions, i.e.,

*p*(

*m*

_{0}|θ) for

*m*

_{0}and

*p*(

*m*

_{90}|θ) for

*m*

_{90}, are generated with the same level of stimulus noise (inversely represented in the model as stimulus precision: κ

_{stimL1}) and the same level of sensory noise (included in the model as sensory precision: κ

_{sensL1}). As described earlier in this article, the external stimulus noise (symmetric in stimulus space) is assumed to follow a von Mises (i.e., circular normal) distribution on the 180° (i.e., half-circular) orientation space with its mean at the actual stimulus orientation value in question and its precision being equal to κ

_{stimL1}. The internal sensory noise (symmetric in sensory space) is expected to follow a von Mises (i.e., circular normal) distribution on the 180° (i.e., half-circular) orientation space with its mean at the expected sensory measurement for the actual stimulus orientation value in question (based on the stimulus-to-sensory mapping, derived from the cumulative density function for the prior distribution) and its precision being equal to κ

_{sensL1}. For implementational details on the computation of the likelihood, we refer the interested reader to the model code, which is publicly available on OSF.

_{stimL1}. The internal sensory noise (symmetric in sensory space) is expected to follow a von Mises (i.e., circular normal) distribution on the 180° (i.e., half-circular) orientation space with its mean at the expected sensory measurement for the actual stimulus orientation value in question (based on the stimulus-to-sensory mapping, derived from the cumulative density function for the prior distribution) and its precision being equal to κ

_{sensL1}. The described stimulus and sensory noise are jointly reflected in the noise of the observer’s representation of the stimulus orientation. The observer’s representation of the stimulus orientation (subject to the stimulus noise and sensory noise described above) is expected to be multimodal, with peaks at the relative 0° , relative 60° and relative 120° orientation. This multimodal distribution (with equal weighting for each of the three distributions) represents the likelihood, and is combined with a prior distribution to compute the posterior distribution for the second lattice. The prior distribution for the second lattice is a perceptual prior distribution, defined as a weighted combination of the prior distribution for the first lattice, indicating the long-term frequency of occurrence (i.e., uniform distribution or with peaks at the cardinals), and the recent perceptual history (i.e., a von Mises distribution with a precision of κ

_{percL1}and its mean at the perceived orientation for the first lattice). From the posterior distribution, either a relative 0°, relative 60°, or relative 120° percept can be sampled with the probabilities depending on the relative probability of perceiving each of the three orientations.

*w*

_{stimL1}), the stimulus prior will update more heavily based on the immediate stimulus history.

*w*

_{percL1}), the perceptual prior will update more heavily based on the immediate perceptual history. Different from the stimulus frequency distribution, the perceptual prior thus includes direct information about the percept/decision/response concerning the first lattice. We assume the precision of the single-peaked von Mises distribution part of the perceptual prior (i.e., κ

_{percL1}) to be smaller than the stimulus or sensory precision for the second lattice (given that the percept for the first lattice is not visually present, this creates the possibility for more noise than for the second lattice, which is visually present).

*p*(

*m*

_{0}|θ),

*p*(

*m*

_{60}|θ), and

*p*(

*m*

_{120}|θ) being the single-peaked likelihoods of the sensory measurements for the relative 0°, 60°, and 120° orientation, respectively. As for the first lattice, each sensory measurement

*m*is modeled as in (4), using the cumulative distribution of the stimulus prior (7) to determine the stimulus-to-sensory mapping. For each stimulus orientation θ

_{i},

*p*(

*m*|θ

_{i}) can be computed according to (4) and the specific noise distributions. Each single-peaked likelihood function is generated with the same level of stimulus noise (inversely represented in the model as stimulus precision: κ

_{stimL2}) and the same level of sensory noise (included in the model as sensory precision: κ

_{sensL2}). As described earlier in this article, the external stimulus noise (symmetric in stimulus space) is assumed to follow a von Mises (i.e., circular normal) distribution on the 180° (i.e., half-circular) orientation space with its mean at the actual stimulus orientation value in question and its precision being equal to κ

_{stimL2}. The internal sensory noise (symmetric in sensory space) is expected to follow a von Mises (i.e., circular normal) distribution on the 180° (i.e., half-circular) orientation space with its mean at the expected sensory measurement for the actual stimulus orientation value in question (based on the stimulus-to-sensory mapping, derived from the cumulative density function for the prior distribution) and its precision being equal to κ

_{sensL2}. Given that the second lattice was presented more briefly than the first lattice (300 ms vs. 800 ms), we assume the sensory precision for the second lattice to be lower than the precision for the first lattice. For implementational details on the computation of the likelihood, we refer the reader to the model code, which is publicly available on OSF.

*perceptual*prior distribution and the likelihood distribution are combined:

*c*

_{stim}influences the strength of the effect of AR on the relative difference in height between the 0° and 90° peaks in the likelihood distribution for the first lattice. When

*c*

_{stim}is increased, AR more heavily influences the difference in height for the 0° and the 90° peak in the likelihood distribution for the first lattice.

_{stimL1}(i.e., stimulus precision for the first rectangular lattice) and κ

_{stimL2}(i.e., stimulus precision for the second hexagonal lattice) influence the general precision of the likelihood peaks for the first and the second lattice, respectively. Stimulus precision does not alter the asymmetry of the likelihood distributions in stimulus space. When κ

_{stim}is decreased, lower stimulus precision or, in other words, more external stimulus noise, is present.

_{sensL1}(i.e., sensory precision for the first lattice) and κ

_{sensL2}(i.e., sensory precision for the second lattice) influence the asymmetry of the likelihood distributions for the first and the second lattice (in stimulus space), respectively. When κ

_{sens}is decreased, lower sensory precision or thus more internal sensory noise is present. Given the difference in presentation time (i.e., 800 ms for the first and 300 ms for the second lattice), we assume κ

_{sensL1}to be higher than κ

_{sensL2}.

*w*

_{stimL1}(i.e., the weight of the posterior of the first lattice on the stimulus prior for the second lattice) determines the relative influence of the short-term effect of the first lattice on the stimulus prior for the second lattice compared to the influence of the long-term natural stimulus distribution.

*w*

_{percL1}(i.e., the weight of the percept of the first lattice on the perceptual prior for the second lattice) determines the relative influence of the percept of the first lattice on the perceptual prior for the second lattice compared to a uniform distribution.

_{percL1}(i.e., the precision of the peak for the percept of the first lattice) reflects the precision of the von Mises distribution used in determining the perceptual prior for the second lattice.

^{−1}, 1.2

^{−1}, 1.1

^{−1}, 1.0, 1.1, 1.2, and 1.3), and the percept of the first lattice (i.e., relative 0° or relative 90° orientation). When using a non-uniform natural stimulus distribution in the prior for the first lattice, we also calculated the probabilities for each absolute lattice orientation (i.e., from 1° to 180° in steps of 1°).

^{3}

*c*

_{stim}), (b) the weight of the posterior of the first lattice on the stimulus prior for the second lattice (

*w*

_{stimL1}), and (c) the weight of the percept of the first lattice on the perceptual prior for the second lattice (

*w*

_{percL1}). To investigate whether we could reproduce the strong positive correlation between individuals’ hysteresis and adaptation effects found in Van Geert et al. (2022), we drew 75 individual parameter combinations for

*c*

_{stim},

*w*

_{stimL1}, and

*w*

_{percL1}from a truncated multivariate normal distribution with means of 5, 6.5, and 5, a lower boundary of zero for all three parameters, an upper boundary of 10 for

*w*

_{stimL1}and

*w*

_{percL1}, and the following variance-covariance matrix:

*w*

_{stimL1}and

*w*

_{percL1}parameters were then rescaled with a maximum of one instead of ten to match the zero-to-one range. We then calculated the probabilities of perceiving the relative 0° orientation in the first and the second lattice for all 75 parameter combinations and calculated the expected frequencies of each response given those probabilities.

*AR*) and the percept of the first lattice (

*R*10) as fixed and random effects. To estimate the direct proximity effect, we used a Bayesian multilevel binomial regression model predicting the percept of the first lattice, with the AR of the first lattice (

*AR*) as fixed and random effect. For more details on these Bayesian analyses, please consult the Supplementary Material as well as Van Geert et al. (2022).

*c*

_{stim}= 5, κ

_{stimL1}= 20, κ

_{sensL1}= 20, κ

_{stimL2}= 20, κ

_{sensL2}= 18, κ

_{percL1}= 10,

*w*

_{stimL1}= 0.60, and

*w*

_{percL1}= 0.50. Whether a uniform prior distribution or a natural stimulus distribution was used as prior for the first lattice did not visibly influence the results. Given the considerable number of parameters, other parameter combinations could give results similar to the one proposed here. Therefore, we provide an online Shiny application in which the user can play with the different parameter values to test their effects, both on the trial and on the experiment level (https://elinevg.shinyapps.io/dotlatticesimulations/).

*w*

_{stimL1}and

*w*

_{percL1}are almost equal, attractive and repulsive effects largely cancel each other out. If

*w*

_{stimL1}is increased and

*w*

_{percL1}is decreased, a stronger repulsive effect is visible (cf. Figure 5b).

^{4}(as the perceptual prior was still combined with the likelihood for the second lattice), but not the repulsive effect of the previous stimulus evidence, as that effect depends on the impact of the first lattice on the stimulus-to-sensory mapping and the likelihood of the second lattice (cf. Figure 5c).

*c*_{stim}is the only parameter influencing the size of the direct proximity effect (i.e., the effect of the AR on the percept of the first lattice; cf. Figure 6a). Through its influence on the likelihood for the first lattice,

*c*_{stim}also indirectly influences the size of the repulsive context effect of the AR on the second lattice (cf. Figure 7a).

_{stimL1}only decreases overall precision of the likelihood distribution for the first lattice (which increases the influence of the prior on the posterior) and a uniform prior distribution is used, a change in κ

_{stimL1}does not have an influence on the relative posterior probabilities for the 0° and 90° orientation in the first lattice. Therefore, κ

_{stimL1}does not influence the size of the proximity effect in case a uniform prior is used for the first lattice (cf. Figure 6b). In the expected probabilities for the second lattice, a higher stimulus precision for the first lattice (i.e., κ

_{stimL1}) results in slightly lower probabilities of perceiving the relative 0° orientation in the second lattice, especially for lower ARs (i.e.., in favor of the relative 0° orientation). In other words, a higher κ

_{stimL1}thus results in a slightly stronger repulsive effect of the previous stimulus evidence (cf. Figure 7b).

_{sensL1}does not influence the relative posterior probabilities for the 0° and 90° orientation in the first lattice. In other words, κ

_{sensL1}does not influence the size of the proximity effect in case a uniform prior is used for the first lattice (cf. Figure 6c). In the expected probabilities for the second lattice, a higher sensory precision for the first lattice (i.e., κ

_{stimL1}) results in a slightly stronger repulsive effect of the previous stimulus evidence (cf. Figure 7c).

_{stimL2}slightly increases the expected probabilities for perceiving the 0° orientation in the second lattice overall, but more so for lower ARs. Hence, a higher κ

_{stimL2}results in a slightly shallower adaptation effect (i.e., repulsive effect of the previous stimulus evidence). Increasing κ

_{sensL2}leads to the opposite effect (cf. Figure 7e): the higher the sensory precision for the second lattice, the stronger the adaptation effect.

_{percL1}is present regardless of the percept for the first lattice being the relative 0° or the relative 90° orientation, the effect of κ

_{percL1}is larger for conditions in which the relative 0° orientation was perceived in the first lattice (cf. Figure 7f).

*w*

_{stimL1}) increases the size of the adaptation effect (cf. Figure 7g). Increasing the weight of the previous percept compared to the long-term uniform perceptual history (i.e.,

*w*

_{percL1}) increases the size of the hysteresis effect (cf. Figure 7h).

*c*

_{stim},

*w*

_{stimL1}, and

*w*

_{percL1}, interindividual variation in proximity, hysteresis, and adaptation effects results. With the currently used parameter combinations, the size of the hysteresis and adaptation effects varied less in the simulation data than in the empirical data, but the simulated variation is plausible given the empirical data (cf. Figure 8 for average results and Figure 9 for individual simulation results). Furthermore, the same relation between hysteresis and adaptation effects is visible as in the empirical data: By generating

*w*

_{stimL1}and

*w*

_{percL1}in a positively correlated manner, we were able to reproduce the empirically found positive correlation between individuals’ attractive and repulsive temporal context effects (cf. Figure 10b). Different from the empirical results in Van Geert et al. (2022), the adaptation effect showed a strong negative correlation with the direct proximity effect in the simulation results and the hysteresis effect showed no correlation with the direct proximity effect (cf. Supplementary Figure 7).

*c*

_{stim}), (b) the weight of the posterior of the first lattice on the stimulus prior for the second lattice (

*w*

_{stimL1}), and (c) the weight of the percept of the first lattice on the perceptual prior for the second lattice (

*w*

_{percL1}). Furthermore, the hierarchical efficient Bayesian observer model could reproduce the empirically observed strong positive correlation between individuals’ attractive and repulsive effects (Van Geert et al., 2022), by assuming a positive correlation between temporal integration constants at the stimulus and the perceptual level. That is, individuals who weight the previous stimulus evidence more highly in relation to the long-term stimulus context will also weight the previous percept more highly in relation to the long-term perceptual context than individuals who weight the previous stimulus evidence less highly. Assuming separate but correlated temporal integration constants at the stimulus and the perceptual level is not implausible in our opinion. For instance, Fritsche et al. (2020) found better performance for a model with different integration time constants for prior and likelihood than for a model that used the same parameters for both. Different from the successful reproduction of the high positive correlation between attractive and repulsive temporal context effects, the correlations between the temporal context effects and the direct proximity effect did not match those observed in the empirical data. Follow-up research may aim to find parameter combinations that provide a closer match to those aspects of the empirical data.

**Authors contributions:**Eline Van Geert: Conceptualization, Data curation, Formal analysis, Funding acquisition, Investigation, Methodology, Project administration, Resources, Software, Validation, Visualization, Writing – original draft, Writing – review and editing; Tina Ivančir: Conceptualization, Formal analysis, Investigation, Methodology, Software, Visualization, Writing – review and editing; Johan Wagemans: Conceptualization, Funding acquisition, Supervision, Writing – review and editing.

**Open and reproducible practices statement:**This manuscript was written in R Markdown using the papaja package (Aust & Barth, 2020) with code for data analysis integrated into the text. The data, materials, and analysis and manuscript code for the experiment are available at https://doi.org/10.17605/OSF.IO/48ESD.

*papaja: Create APA manuscripts with RMarkdown*. Retrieved from https://github.com/crsh/papaja.

*Journal of Vision,*20(12), 9, https://doi.org/10.1167/jov.20.12.9. [CrossRef] [PubMed]

*PLoS One,*3(1), e1497, https://doi.org/10.1371/journal.pone.0001497. [CrossRef] [PubMed]

*Journal of Vision,*17(14), 6, https://doi.org/10.1167/17.14.6. [CrossRef] [PubMed]

*Proceedings of the National Academy of Sciences of the United States of America,*95(7), 4002–4006, https://doi.org/10.1073/pnas.95.7.4002. [CrossRef] [PubMed]

*Current Biology: CB,*27(4), 590–595, https://doi.org/10.1016/j.cub.2017.01.006. [CrossRef] [PubMed]

*eLife,*9, e55389, https://doi.org/10.7554/eLife.55389. [CrossRef] [PubMed]

*Experimental Brain Research,*160(4), 487–495, https://doi.org/10.1007/s00221-004-2038-3. [CrossRef] [PubMed]

*Nature Neuroscience,*14(7), 926–932, https://doi.org/10.1038/nn.2831. [CrossRef] [PubMed]

*Cognitive Psychology,*35(1), 71–98, https://doi.org/10.1006/cogp.1997.0673. [CrossRef] [PubMed]

*Proceedings of the National Academy of Sciences of the United States of America,*118(13), e2012938118, https://doi.org/10.1073/pnas.2012938118. [CrossRef] [PubMed]

*Psychonomic Bulletin & Review,*25(6), 2245–2253, https://doi.org/10.3758/s13423-018-1454-5. [PubMed]

*Psychological Review.*Advance online publication, https://doi.org/10.1037/rev0000457.

*Current Biology,*26(13), 1669–1676, https://doi.org/10.1016/j.cub.2016.04.065.

*Current Biology,*23(10), https://doi.org/10.1016/j.cub.2013.03.024.

*Cognition,*232, 105334, https://doi.org/10.1016/j.cognition.2022.105334. [PubMed]

*PLOS Biology,*19(5), e3001215, https://doi.org/10.1371/journal.pbio.3001215. [PubMed]

*PLoS Biology,*17(3), e3000144, https://doi.org/10.1371/journal.pbio.3000144.

*R: A language and environment for statistical computing*. Vienna, Austria: R Foundation for Statistical Computing. Retrieved from https://www.R-project.org/.

*Psychonomic Bulletin & Review,*31(1), 259–273, https://doi.org/10.3758/s13423-023-02320-3. [PubMed]

*Cerebral Cortex,*24(5), 1152–1164, https://doi.org/10.1093/cercor/bhs396.

*Current Biology,*28(18), R1094–R1095, https://doi.org/10.1016/j.cub.2018.07.066.

*Frontiers in Human Neuroscience,*9, https://doi.org/10.3389/fnhum.2015.00594.

*Vision Research,*50(5), 541–547, https://doi.org/10.1016/j.visres.2009.12.005. [PubMed]

*I-Perception,*13(4), 20416695221109300, https://doi.org/10.1177/20416695221109300. [PubMed]

*Nature Neuroscience,*18(10), 1509–1517, https://doi.org/10.1038/nn.4105. [PubMed]