THE ONLINE MCMC

Do you have some data and a model that you want to fit to it? Well here's the website for you (see caveats). On this website you can input a model function defined by a set of parameters including those that you want fit, and your data, and it will run a Markov chain Monte Carlo (MCMC) algorithm to estimate the posterior probability distributions of those parameters. This site makes use of the python MCMC package emcee written by Dan Foreman-Mackey.

EXAMPLES


This site generates 2 plots: one of the posterior plots for each parameter that the user defines...

Image

... and another showing the distribution of all the best fit models that were drawn randomly from the posterior distribution.

Image

While full instructions and explanations can be found here, the following video showing how to use the website might also be useful. In this case a basic linear model and a small data set were used for simplicity.

INPUT

Instructions for using this page can be found below the input options.

Input model equation:


Input the data:



Input the likelihood:

Input the MCMC sampler parameters:
• Number of ensemble points (default: 100)
• Number of MCMC interations (default: 1000)
• Number of MCMC burn-in interations (default: 1000)

Please supply your email address. A link to your results will be sent to you once it is complete:


Any results will be available for 15 days following completion.
They will then be deleted, so please download any results that you would like to keep for longer.

INSTRUCTIONS

The model

Firstly, you must input the model that you want to fit to your data. When inputting this model you can use the standard operators "+", "-", "*" (multiplication), "/" (division). Allowable functions (such as trigonometric functions) and constants are listed below. To raise a value to a given power use either "^" or "**".

When entering the model be careful to use parentheses to group the required parts of the equation. Click here to show an example input model.


Parameter types

Once the model is submitted you can choose each parameter's type:


Prior

There are currently three prior probability distributions that you can choose for a variable:

If you are unsure about what is best to use then a Uniform distribution with a range broad enough to cover your expectations of the parameter is the simplest option.


Data input

Input the data that you would like to fit the model to. You can directly choose to input values directly in the form below (with whitespace or comma separated values), or upload a file containing the data (again with whitespace, or comma separated values). The number of input data points must be the same as the number of values input for the independent variable/abscissa parameter provided above.


Likelihood input

There are currently two allowed likelihood functions:


MCMC inputs

The MCMC aims to draw samples (a chain of points) from the posterior probability distributions of the parameters. You need to tell it how many points to draw. There are three inputs required:

If in doubt use the defaults and see how things turn out.

ALLOWABLE FUNCTIONS AND CONSTANTS

Here is a list of allowable functions within your model. When entering your model use the form given in the monospace font, with the function argument surrounded by brackets, e.g. sin(x).

Trigonometric functions

Other functions

Constants

These constants can be input rather than having to give their numerical values.

CAVEATS

The MCMC algorithm is not guaranteed to produce sensible results every time, and your output may contain errors or look odd. Some information and trouble shooting can be found here.

If users really want to understand what is being done by this code I would advise learning about Bayesian analyses and Markov chain Monte Carlo methods. I would also advise learning python, or another programming language, and coding the analysis up themselves, particularly if you have a more complex problem. However, this site aims to be useful starting point.