Skip to content
ANTO I LONAPPAN edited this page Jun 15, 2018 · 12 revisions

Welcome to the Bayesian Evidence Plotter wiki!

Bayesian statistics plays an important role in data analysis. Particularly in the case of model comparison, Bayesian evidence and Bayes factor determination are well-known methods. This python module can plot beautiful 2D plots, with the x-axis as models and y-axis as log evidence.For determining log evidence you can use pymultinest or nestle.

Installation

git clone https://github.com/antolonappan/Bayesian-Evidence-Plotter.git.

cd Bayesian-Evidence-Plotter.

python setup.py install

Files required

  • ModelXX.txt : Text file containing models name or label each separated by a line. The user can include LaTex format here. First entry of this file must be the reference model with which Bayes factor is to be determined.

  • EvidenceXXX.txt : Text file containing models' log-evidence in the same order of ModelXX.txt

Using evidence_plotter

from evidence_plotter import plotter

fig = plotter('model.txt','evidence.txt','legend_of_plot')

fig.plot()

If no error occurred, plot will be saved as 'legend_of_plot.pdf'

Plotter

Default Values

plotter(model_file, evidence_file, plotlabel, color='color', linec='black', lw_ref=0.3, lw_bf=0.2, bf_x=0.2, bf_y=0.2, ts=10)

  • model_file : File containing model names.
  • evidence_file : File containing log evidence values.
  • plotlabel : Legend of the plot, for example data used for comparing models.
  • color : The avialable options are 'color' and 'bw', 'color' makes a color plot whereas 'bw' makes a black and white plot.
  • linec : The options are 'colored' and 'black'. colored makes the evidence line same color as the buble. black plots the line in black color but the buble remains colored. linec won't work if the argument 'color' is 'bw'.
  • lw_ref (optional) : Line width of reference dashed line.
  • lw_bf (optional) : Line width of verticle line.
  • bf_x (optional) : x-axis tuning for placing Bayes factor values.(0.1<bf_x<0.4)
  • bf_y (optional) : y-axis tuning for placing Bayes factor values.(0.1<bf_y<0.4)
  • ts (optional) : Font size and title size

Other properties of this class are Jef_color, Jef_black, and Jef_marker. This is not user accessible, So if the user wants to change those properties change it from the script.

How to read the plot

For a particular model, if the evidence point is above the reference dashed line the Bayes factor tells the evidence of that model against the reference model, else it's the evidence of the reference model against that model. For evidence scale, please refer to Jeffrey's scale

Clone this wiki locally
You can’t perform that action at this time.