Coder Social home page Coder Social logo

tillahoffmann / summaries Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 234 KB

Comparison of summary statistic selection methods with a unifying perspective.

Home Page: https://arxiv.org/abs/2206.02340

License: BSD 3-Clause "New" or "Revised" License

Makefile 1.63% Python 97.15% Stan 0.94% R 0.28%
conditional-density-estimation data-compression information-theory likelihood-free-inference simulation-based-inference summary-statistics approximate-bayesian-computation

summaries's Introduction

summaries

image

This repository accompanies the preprint "Minimizing the expected posterior entropy yields optimal summary statistics" and can be used to reproduce all figures and reported results.

You can reproduce the results in three steps:

  1. Set up a new, clean python virtual environment (you can also skip this step to use your host python environment, but your mileage may vary).
  2. Install all the requirements by running pip install -r requirements.txt.
  3. Generate all result files by running the following code from the command line.
# Ignore the figures until we have generated all data files.
doit ignore figures
# Generate the data files (use -n to parallelize if desired).
doit -n [number of cores]
# Generate the figures and a summary file `workspace/figures/figures.html`.
doit forget figures
doit figures

You will find all figures in the folder workspace/figures together with a HTML report workspace/figures/figures.html that contains additional information. This process takes about 40 minutes on an M1 MacBook Pro when parallelizing across six cores.

The code has been tested with python 3.9 on macOS 12.4 (Monterey) running on Apple silicon and on Ubuntu 20.04. The summaries package has complete test coverage, and you can run pytest from the repository root to verify that your installation is working.

summaries's People

Contributors

tillahoffmann avatar

Watchers

 avatar  avatar

summaries's Issues

Design benchmark and evaluation.

โš™๏ธ Benchmark model and data

We would like to design a benchmark model that

  • is sufficiently varied to be interesting.
  • has a tractable (but non-trivial) likelihood.
  • allows for the posterior to evaluated (probably using numerical integration for the normalisation constant).

๐Ÿค” Inference

Any inference method applied to the synthetic benchmark dataset should take as input

  • the training data (e.g. to be used as a reference table for ABC, training data for feature learning, or conditional density estimation).
  • the validation data (e.g. to be used for selecting a good acceptance threshold or early stopping in training).

and return a function def sample_posterior(x: np.ndarray) -> np.ndarray to draw samples from the posterior.

The ultimate, unified output of the inference pipeline is a set of posterior samples for each test dataset and each inference/feature selection method. Each method may also produce other output, such as the gridded posterior obtained from numerical integration.

๐Ÿ“ˆ Evaluation

For each method, we will compare posterior samples against the "true" posterior obtained by numerical integration. Candidate evaluation approaches include

  • Kullback-Leibler divergence between the true and approximate posteriors (but that requires density estimation on the unit square--or some other KL estimator).
  • discrepancy (e.g. RMSE) between some point estimate of the posterior (e.g. posterior mean) and the true parameter value (but that doesn't really capture how well we're approximating, only how good the point estimate is). Maybe the discrepancy between the true and approximate posterior mean is better.

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.