Weiss, Y., Simoncelli, E. P., & Adelson, E. H. (2002). Motion illusions as optimal percepts. Nature Neuroscience, 5(6), 598–604. doi:10.1038/nn858

First, just create our imports and define a few helper functions to get started:

Define a few options for the prior. In the paper, they used the equivalent of prior1, but I’m also interested in comparing to a uniform prior and a Gaussian prior with different mean:

Now, define the full model. This assumes a thin rhombus, but the prior function and the contrast (i.e., inverse sigma) can be modified:

Original prior, high contrast:

Original prior, low contrast:

VA prior, high contrast:

VA prior, low contrast:

Uniform prior, high contrast:

Uniform prior, low contrast: