This is a repository for bayesian analysis. This framework is built upon the hic-param-est package from Jonah Bernhard.
-
Install python3, with packages
emcee
,h5py
,numpy
,scikit-learn
,scipy
,matplotlib
,corner
. Use pip to install them if needed -
If you don't have R, download R from here
-
Open an R Console instance by opening the R app or by typing R in the command line.
-
In the R console, type the command
install.packages('lhs')
and pick an appropriate download mirror if prompted. To ensure the package was properly installed, typelibrary(lhs)
in the R console. If that command runs without error, the package is installed. Close the R console by typingquit()
.
A toy model example can be run under the toy_model/
folder
-
The toy model
y1 = A exp(-B x^2); y2 = C cosh(D x)
A, B, C, D are the model parameters to fit.
-
The prior parameter range is defined in
toy_model/ABCD.txt
-
Generating the training data sets
python3 -m src.design -par toy_model/ABCD.txt -n 500 toy_model cd toy_model for i in `ls main`; do python3 toy_model.py -i main/$i; done mkdir model_results; mv run_* model_results
-
Generate the pseudo experimental data
cd toy_model; python3 toy_model.py --exp
-
Run Bayesian Analysis
The Bayesian analysis can be performed using the Jupyter Notebook
Run_BayesianAnalysis.ipynb