Learn Bayes with Binomial Estimation in JASP

When students are first confronted with Bayesian statistics they have to become familiar with key concepts that differ fundamentally from those that they were taught in frequentist courses. To assist the transition to Bayesian inference we recently created the “Learn Bayes” module in JASP (with support from a grant from the APS Fund for Teaching and Public Understanding of Psychological Science). The Learn Bayes module –which will be expanded in the near future– illustrates all steps of Bayesian parameter estimation and testing, and invites the students to explore the outcome of alternative scenarios (e.g., other data, other priors, additional models). All output is supported by introductory texts that provide further explanations.

In this blogpost we outline the Binomial Estimation analysis, which illustrates the key concepts associated with Bayesian estimation of a simple binomial chance parameter. In the JASP GUI, the analysis can be split into five sections, each with its own purpose.


The “Data” section is designed to specify the data input. We can either use a variable from a dataset loaded into JASP (i.e.,  a variable that contains successes and failures), we can indicate the total number of successes and failures, or we can enter the observations as a sequence. For example, we can specify the order of red and blue balls picked out of a bag and label a red ball a “success” and a blue ball a “failure”, as indicated in the figure below:


The “Model” section is used to specify the models that will be used for estimating the underlying parameter θ (i.e., the population proportion of successes). We can specify the model name, the prior distribution for the parameter θ, and parameters that define the distribution. Here, we specify a prior spike distribution (a distribution with the density concentrated on a single point) at value 0.5 for a model called Arnold, and a beta (1, 1) distribution for a model called Bart.


The purpose of the “Inference” section is to draw conclusions from the specified models. The figure above already shows the default Estimation Summary table with the prior and posterior distributions for each model and their point estimates. Furthermore, the options allow users to visualize the prior and posterior distributions using a range of figures. The following figure shows the prior distributions side by side using the “All” option:



whereas the next figure displays the posterior distributions with a depth effect using the “Stacked” option.

Another option is to display the distributions individually, with the possibility of including point and interval summaries (which we will demonstrate in the last section).


Sequential Analysis
The “Sequential Analysis” section presents the results of Bayesian estimation sequentially, one observation at the time (available only with non-aggregated data). The following figure shows how the posterior mean estimates and 95% central credible intervals change with the additional observations.

Furthermore, we can also visualize the proportion of the posterior mass inside a specified interval using the “Interval” option, or show a table of how the posterior distribution is updated with each additional observation.


Posterior Prediction
The “Posterior Prediction” section is designed to assess the predictions from the updated models. It offers the same types of figures as the “Inference” section with an additional option to display predictions for the future sample proportions. The following figures visualize the predictions for a future set of 10 observations based on the updated posterior distributions for each of our models. The bars that fall inside the central 95% credible interval have a darker color than those that fall outside.

However, there is more to Bayesian inference than parameter estimation. In the next week’s blog post, we will illustrate Bayesian testing using the Binomial Testing analysis from the Learn Bayes module.

About the authors

František Bartoš

Eric-Jan Wagenmakers

Eric-Jan (EJ) Wagenmakers is professor at the Psychological Methods Group at the University of Amsterdam. EJ guides the development of JASP.