Giter VIP home page Giter VIP logo

pydnest's Introduction

PyDNest

Python connection to Diffusive Nested Sampling.

Install

  1. Compile DNest into a shared library:

    cd /dir/to/DNest3 patch -p1 < /dir/to/PyDNest/dnest3-build-sharedlib.patch

rebuild DNest as usual (cmake, make) You should find libdnest3s.so in the build directory.
  1. Build the PyDNest bridge:

    cd PyDNest
    make
    
You should find libdnestbridge.so in this directory.
  1. You are ready to go. Try the example in run.py. First tell it where to find the two libraries you created:

    export LD_LIBRARY_PATH=/dir/to/DNest3/build/:/dir/to/PyDNest/

    python run.py

Usage

For using in your application, just import run.py and pass your functions to dnest_run. You need to define

  1. int allocate(): makes a new particle. returns a integer (or C-pointer) to know which particle we are talking about.
  2. double drawFromPrior(i): gets the integer from above, and draws a position from the prior for it (storing the position somewhere).
  3. perturb(i): gets the integer from above, and modifies the position. Returns H (usually 0?).
  4. likelihood(i): gets the integer from above, and returns the likelihood for this particle.

Author: Johannes Buchner

pydnest's People

Contributors

johannesbuchner avatar

Stargazers

Brendon J. Brewer avatar

Watchers

James Cloos avatar Brendon J. Brewer 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.