On this website you can input a model function defined by a set of parameters, including those that you want fit, as well as your data, and it will run a statisical sampling algorithm to estimate the posterior probability distributions of those parameters.

This site makes use of the Bayesian inference python package Bilby to access statisical samplers. Beyond Markov chain Monte Carlo (MCMC), users are able to select from a variety of statistical samplers and it is encouraged to trial a variety to achieve the best performance for your model.

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

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

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.

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

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.

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 "**". It is advised to plot just your data points initially to give an indication of what model you could use.

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.

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

**constant**: the parameter is a fixed constant that you can define a numerical value for;**variable**: the parameter is a variable that you would like to fit and for which you will need to define a prior (see here for information on the prior type);**independent variable / abscissa**: the parameter is a value, or set of values, at which the model is defined (e.g. in the above example the`t`

(time) value could be such a parameter) that you can input directly or through file upload (uploaded files can be plain ascii text with whitespace or comma separated values). Currently only one parameter can be given as an*independent variable*, i.e. only one-dimensional models are allowed.

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

**Uniform**: this is a constant probability distribution defined within a minimum and maximum range, with zero probability outside that range. This is a non-informative prior for a location parameter (i.e. a parameter that is invariant to shifts);**Log(Uniform)**: this is a constant probability distribution in the logarithm of the parameter, defined within a minimum and maximum range, with zero probability outside that range. This is a non-informative prior for a scale parameter (i.e. a parameter that is invariant to scalings and can only take positive values);**Gaussian**: this is a Gaussian (or Normal) probability distribution for which the mean and standard deviation must be specified. This is the least informative distribution if only the mean and standard deviation are known.**Exponential**: this is an Exponential probability distribution (\(e^{-x/\mu}\)) for which the mean,*μ*, must be specified. This is the least informative distribution if only the mean is known.

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.

There are currently three given likelihood functions:

**Gaussian**: a Gaussian (or Normal) probability distribution (this is one of the most common, and is often the least informative, likelihood functions). If using this likelihood function there are three additional options:- input a single known value for the standard deviation, σ, of noise in the data;
- input a set of values (either directly into the form as a set of whitespace or comma separated values, or though uploading an ascii text file of the values) of the standard deviation of the noise, with one value per data point;
- choose to include the noise standard deviation as another parameter to be fit (i.e. if it is unknown). If you choose this option then a prior (as above) is required.

**Student's**: the Student's*t**t*likelihood is similar to the Gaussian likelihood, but it does not require a noise standard deviation to be given (the noise is assumed to be stationary over the dataset and has been analytically marginalised over).**Poisson**: the Poisson distribution is similar to the Gaussian, however it deals with discrete random variables, such as counting a radioactive decay source. The data input therefore is required to be integer counts and only positive values.

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:

*No. of ensemble points ("walkers")*: this is essentially the number of independent chains within the MCMC. This needs to be an even number and in general should be at least twice the number of fitting parameters that you have. Using a large value (e.g. 100) should be fine, but you could run into lack-of-memory issues if the number is too high (1000s);*No. of iterations*: this is the number of points per chain for each of the ensemble points. The product of this number and the number of ensemble points will be the total number of samples that you have for the posterior;*No. of burn-in iterations*: this is the number of iterations (for each "walker") that are thrown away from the start of the chain (the iteration points above come after the burn-in points). This allows time for the MCMC to converge on the bulk of the posterior and for points sampled away from that to not be included in the final results.

Dynesty is a Nested Sampler. Nested sampling is similar to the MCMC method, however it draws up many live points throughout the prior volume. As the program iterates, the lowest likelihood points are discarded and replaced by ones with a higher likelihood.

Additionally, Dynesty dynamically assigns new live points as the algorithm iterates, dramatically improving efficiency compared to standard nested sampling. For Dynesty, only one input is required:

Additionally, Dynesty dynamically assigns new live points as the algorithm iterates, dramatically improving efficiency compared to standard nested sampling. For Dynesty, only one input is required:

*No. of live points*: this is described in greater detail here. This needs to be a positive integer and in general should be at least 1 greater than the number of fitting parameters that exist.

Nestle is a static nested sampling algorithm that offers greater choice to how new live points are selected. "Classic" implements a traditional algorithm with MCMC walks for new points, where "Single" and "Multi" draw new points from within ellipsoids encompassing high likelihood areas. It is recommended to read the documentation to learn more here. For Nestle, two inputs are required:

*No. of live points*: the number of active points, a positive interger at least one greater than the number of fitting parameters that exist.*Method*: How the sampler chooses new points within the target parameter space. Currently can choose from 'Classic', 'Single' or 'Multi'. Further information can be found here

PYMC3 is an alternative MCMC sampler. For PYMC3, three inputs are required:

*No. of draws*: The number of sample draws from the posterior per chain.*No. of chains*: The number of independent MCMC chains to run.*No. of burn-in iterations*: this is the number of iterations (for each "walker") that are thrown away from the start of the chain (the iteration points above come after the burn-in points). This allows time for the MCMC to converge on the bulk of the posterior and for points sampled away from that to not be included in the final results.

- Sine: sin
- Inverse sine: asin or arcsin
- Cosine: cos
- Inverse cosine: acos or arccos
- Tangent: tan
- Inverse tangent: atan/atan2 or arctan/arctan2
- Hyperbolic sine: sinh
- Inverse hyperbolic sine: asinh or arcsinh
- Hyperbolic cosine: cosh
- Inverse hyperbolic: cosine acosh or arccosh
- Hyperbolic tangent: tanh
- Inverse hyperbolic tangent: atanh or arctanh

- Exponential function
*e*: exp - Natural logarithm (base
*e*): log - Commom logarithm (base 10): log10
- Binary logarithm (base 2): log2
- Gamma function: gamma
- Error function: erf
- Factorial "!": factorial
- Heavside function : heaviside
- Piecewise function : piecewise

- π: pi

The sampling algorithms provided are not guaranteed to produce sensible results every time, and your output may contain errors or look odd. Some information and trouble shooting for the samplers can be found here.

For very high SNR models, it is possible for MCMC solutions to converge very slowly as exploring the parameter space becomes difficult. For such cases, solutions will take longer to be produced.

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.