This mathlet shows Bayesian updating with simulated data for two
different likelihood functions (binomial and geometric) with a
conjugate prior distribution (beta).
The data distribution radio buttons allow the user
to choose the probability distribution for the data, i.e. the
likelihood function. With each likelihood function there are sliders
that can be used to set its parameters.
The top graphing window shows the probability mass
function for the likelihood.
The \(\boldsymbol{a}\) and \(\boldsymbol{b}\)
sliders are used to set the parameters of the initial prior
distribution \(Beta(a, b)\) for the \(\theta\) parameter of the
likelihood function. Moving these sliders also resets the data and
graphs (see reset button below).
The \(\boldsymbol{X}\) slider is used to simulate
data. Every time the user clicks on a value the mathlet uses that as
data from one trial and updates the prior to a posterior
distribution for \(\theta\). The new posterior is shown in blue
below the \(X\) slider and the previous posterior distribution
becomes the new prior distribution.
The bottom graphing window shows graphs of the
sequence of posterior distributions. The current posterior is shown
in light blue and the current prior is shown in green. Earlier
posteriors/priors are shown in a darker blue.
The reset button clears the bottom graph and sets
the prior distribution to its initial state based on the values of
the \(a\) and \(b\) sliders.
The \(\boldsymbol{x}\) and \(\boldsymbol{y}\)
readouts show the position of the mouse when it is in
either graphing window.