Git Product home page Git Product logo

bayesian_analysis's Introduction

Bayesian Analysis

This is a repository for bayesian analysis. This framework is built upon the hic-param-est package from Jonah Bernhard.

Installation

  1. Install python3, with packages emcee, h5py, numpy, scikit-learn, scipy, matplotlib, corner. Use pip to install them if needed

  2. If you don't have R, download R from here

  3. Open an R Console instance by opening the R app or by typing R in the command line.

  4. 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, type library(lhs) in the R console. If that command runs without error, the package is installed. Close the R console by typing quit().

Test Run with a toy model

A toy model example can be run under the toy_model/ folder

  1. The toy model

    y1 = A exp(-B x^2); y2 = C cosh(D x)

    A, B, C, D are the model parameters to fit.

  2. The prior parameter range is defined in toy_model/ABCD.txt

  3. 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
    
  4. Generate the pseudo experimental data

    cd toy_model; python3 toy_model.py --exp

  5. Run Bayesian Analysis

    The Bayesian analysis can be performed using the Jupyter Notebook Run_BayesianAnalysis.ipynb

bayesian_analysis's People

Contributors

chunshen1987 avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.