Coder Social home page Coder Social logo

desilike's Introduction

desilike

desilike is an attempt to provide a common framework for writing DESI likelihoods, that can be imported in common cosmological inference codes (Cobaya, CosmoSIS, MontePython).

desilike has the following structure:

  • root directory: definition of parameters, base calculator classes, differentiation and Fisher routines, installation routines
  • theories: e.g. BAO, full-shape theory models
  • observables: e.g. power spectrum, correlation function
  • likelihoods: e.g. Gaussian likelihood of observables, a few external likelihoods (Pantheon, Planck)
  • bindings: automatic linkage with cobaya, cosmosis, montepython
  • emulators: emulate e.g. full-shape theory models, to speed up inference
  • samples: define chains, profiles data structures and plotting routines
  • samplers: many samplers for posterior sampling
  • profilers: profilers for posterior profiling

samples, samplers and profilers are provided for self-contained sampling / profiling of provided likelihoods. Example notebooks presenting most use cases are provided in directory nb/.

TODO

When autodiff is available, pass gradient to profilers / samplers whenever relavant. For ParameterArray, define when output should be a ParameterArray (e.g. under affine transforms) or not.

Documentation

Documentation in construction on Read the Docs, desilike docs. See in particular getting started.

Requirements

Only strict requirements are:

  • numpy
  • scipy
  • pyyaml
  • mpi4py
  • cosmoprimo (currently with pyclass to compute DESI fiducial cosmology)

Should be made optional in the future:

  • mpi4py
  • pyclass (by extending TabulatedDESI to power spectra)

Installation

pip

Simply run:

python -m pip install git+https://github.com/cosmodesi/desilike

If you wish to use plotting routines (getdist, anesthetic), and tabulate for pretty tables:

python -m pip install git+https://github.com/cosmodesi/desilike#egg=desilike[plotting]

If you addtionally wish to be able to use analytic marginalization with jax:

python -m pip install git+https://github.com/cosmodesi/desilike#egg=desilike[plotting,jax]

git

First:

git clone https://github.com/cosmodesi/desilike.git

To install the code:

python setup.py install --user

Or in development mode (any change to Python code will take place immediately):

python setup.py develop --user

Other dependencies (theory codes, etc.)

Just define your calculator (most commonly your likelihood), then in a python script:

from desilike import Installer
Installer(user=True)(likelihood)

License

desilike is free software distributed under a BSD3 license. For details see the LICENSE.

Acknowledgments

desilike's People

Contributors

adematti avatar echaussidon avatar erikzaborowski avatar rodri981 avatar pltaylor16 avatar vincenzoaronica avatar kalusb avatar zhaoruiyang98 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.