Home Download Help Resources Extensions FAQ References Contact Us Donate Models: Library Community Modeling Commons User Manuals: Web Printable Chinese Czech Japanese Spanish

NetLogo User Community Models(back to the NetLogo User Community Models)
## WHAT IS IT?
This model illustrates how individual spikes and nonspikes can be interpreted as measurements about some state of the world, and how we can perform Bayesian inference on those measurements to infer about the world. In this model, the state of the world considered is the distance D from a predator (red) to a prey (blue). Given a probabilistic model of spiking given D, Pr(SD), Bayes' rule states how to calculate Pr(DS) given the outputs of the neurone.
## HOW IT WORKS
The predator has a neurone that fires a spike on a time step with probability Pr(SD), as outlined in the manuscript. Given this conditional probability, which is plotted at the bottom of the screen, and a prior distribution Pr(D), we can infer the prey location Pr(DS) by Bayes' rule. By letting the posterior distribution Pr(DS) become the prior on the next time step, we can perform Bayes' rule recursively in time.
## HOW TO USE IT
To start, set the parameters of the model to your desired values. Choose whether the prior is a normal, uniform, or Diracdelta distribution. Click the `setup' button, and you're ready to run simulations.
Next, click the `go' button. Click the button once to start running a simulation, and click again to pause it. The model is run at a sufficiently slow speed so that the viewer can see how individual spikes (and nonspikes) can be used to perform Bayesian inference about D. Every time step is one millisecond in duration. When the predator's neurone spikes in a time step, the predator's neurone flashes white and makes a pulse of sound. By Bayes' rule, the posterior Pr(DS) shifts to the left. When the neurone doesn't spike in a time step, the posterior decays to the right. The observed spike train is streamed below. The sensor's conditional probabilities of spiking are in the lowest plot.
## THINGS TO NOTICE
Pr(DS) converges quickly to the observed prey location when D is small, often in less than 500 time steps (onehalf of one second in realtime), and even when the gain/noise ratio for the sensor is extremely small. When D is small (say 0.05 or so), then Pr(DS) quickly converges on D = d, in as little as 20 or 30 timesteps, despite low gaintonoise ratios.
The convergence of the posterior distribution to the observed prey location is insensitive to the prior distribution of the prey, so long as the prior has reasonably heavy tails. To verify this, run the model for a uniform, normal, and diracdelta prior by changing the chooser labeled 'prior?' The posterior Pr(DS) will converge on the observed prey location D = d, so long as the prior is not inconsistent with the observed prey location.
## THINGS TO TRY
Investigate how the gaintonoise ratio affects the speed of convergence of Pr(DS) to the observed value of D = d.
Investigate how the observed value of D = d affects the speed of convergence of Pr(DS). The larger D = d is, the longer it takes Pr(DS) to converge to D = d.
## EXTENDING THE MODEL
Spatial distributions of these sensors can provide information on the location of other organisms in higher dimensions. This is consistent with the notion of "skin brains" (Holland 2003).
To deal with the more general case of prey moving, we need to introduce the conditional probability Pr(X(t)X(t1)) (a dynamic prior). Then, the neurone becomes a rudimentary particle filter. 
(back to the NetLogo User Community Models)