Code Monkey home page Code Monkey logo

avant's Introduction

avant

Create informed priors for reflectometry analysis

PyPI version Coverage Status python-ci Build status Documentation Status

avant is a python package to extract values from refl_database to create informed or uniform priors to be used in reflectometry analysis.

The aim of avant is to improve reflectometry analysis by applying Bayesian Statistics and creating 'informed priors' which take into account literature values in the prior probability distributions of the parameters. The priors are created in a way where they can be directly implemented in Refnx to perform reflectometry analysis. Plus, the package has plotting functionalities so you can see what the prior probability distributions look like.

Features

Currently, avant only contains priors for the following five parameters for DMPC: head volume, tail volume, head thickness, tail thickness and roughness. It can create an informed prior, Gauss, with the following methods:

  • pdf : probability distribution function
  • logpdf : natural log of the probability distribution function
  • cdf : cumulative distribution function
  • ppf : percentile point function (quantile function / inverse cdf)
  • rvs : random variate sampling

It can also create a uniform prior which is an upper and lower bound for the prior range. The following plotting functionalities are available:

  • plotGauss(name='DMPC'): Plot a 'Gauss' prior probability distribution.
  • plotUniform(name='DMPC'): Plot a uniform prior probability distribution.

Examples

  1. Plotting the informed prior for head volume for DMPC:

    import avant.parameter.vh as vh
    vh.plotGauss('DMPC') 
    

dmpc_vh

  1. Plotting the uniform prior for the head volume for DMPC:

    import avant.parameter.vh as vh
    vh.plotUniform('DMPC')
    

dmpc_vh_u

  1. Set a parameter equal to the Gauss object (can be used in Refnx)

    import avant.parameter.vh as vh
    x = vh.Gauss('DMPC')
    

Problems

If you discover any issues with avant feel free to either submit the issue to our issue tracker on Github, or fix the issue yourself and make a pull request to the main branch.

Installation

avant is available on PyPI so can be installed using pip, otherwise this repository can be cloned and the latest build can be installed using the following:

pip install -r requirements.txt
python setup.py build
python setup.py install
pytest

Contributors

License

The project is licensed under the MIT license.

avant's People

Watchers

 avatar  avatar

Forkers

andyfaff

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.