Giter Site home page Giter Site logo

juliaapproxinference / likelihoodfreeinference.jl Goto Github PK

View Code? Open in Web Editor NEW
6.0 2.0 0.0 11.5 MB

Likelihood-Free Inference for Julia.

License: Other

Julia 100.00%
abc approximate-bayesian-computation likelihood-free-inference approximate-bayesian-inference likelihood-free

likelihoodfreeinference.jl's People

Contributors

github-actions[bot] avatar jbrea avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

likelihoodfreeinference.jl's Issues

Towards a full fledged powerful ABC package

Introduction

There are currently a few different and unrelated packages for Approximate Bayesian Computation and Likelihood-Free Inference in julia. As mentioned on discourse, it may be nice to coordinate ABC efforts in julia a bit; at least I would enjoy this, 😄. In the following I try to give a brief overview of the current state. I spent limited time on reviewing the packages. Apologies if I missed something and please correct all my mistakes! After that, I make a few propositions.

Current State

ApproximateBayesianComputing.jl @eford

Methods

  • ABC-PMC, Beaumont et al. 2002

API

model(params) = ...
setup = method_plan(model, compute_summary_statistics, metric, prior; kwargs...)
result = run_abc(setup, data; kwargs...)

Features

  • Additional Distributions:
    • GaussianMixtureModelCommonCovar
    • GaussianMixtureModelCommonCovarTruncated
    • GaussianMixtureModelCommonCovarSubset
    • GaussianMixtureModelCommonCovarDiagonal
    • MultiUniform
    • LinearTransformedBeta
    • GenericCompositeContinuousDist
  • parallel evaluation (?)
  • Gaussian Processes emulation

GPABC.jl @tanhevg

Methods

  • Rejection ABC
  • ABC-SMC (Toni et al. 2009)
  • Emulated ABC-Rejection
  • Emulated ABC-SMC
  • ABC model selection (Toni et al. 2010)

API

model(params) = ...
result = method(data, model, prior, args...; kwargs...)

Features

  • Plotting recipes
  • Stochastic Linear Inference (LNA)
  • Custom GP implementation (see e.g. GaussianProcesses.jl for an alternative)
  • Utilities to compute summary statistics

ApproxBayes.jl @marcjwilliams1

Methods

  • Rejection ABC
  • ABC-SMC (Toni et al. 2009)
  • ABC model selection (Toni et al. 2010)

API

model(params, constants, targetdata) = ...
setup = method(model, args..., prior)
result = runabc(setup, data; kwargs...)

Features

  • Plotting recipes
  • Composite Prior
  • Custom distance ksdist
  • multi-threading

KissABC.jl @francescoalemanno

Methods

  • Rejection ABC
  • ABC-SMC (Drovandi et al. 2011)
  • ABC-DE (Turner and Sederberg 2012)
  • Kernelized ABC-DE

API

model(params, constants) = ...
setup = ABCPlan(prior, model, data, metric)
result = method(setup, kwargs...)

Features

  • Factored Distribution
  • parallel evaluation (multi-threading)

LikelihoodfreeInference.jl (myself)

Methods

  • PMC-ABC (Beaumont et al. 2002)
  • Adaptive SMC (Del Moral et al. 2012)
  • K2-ABC (Park et al. 2016)
  • Kernel ABC (Fukumizu et al. 2013)
  • Approximative Maximum A Posterior Estimation
    • Kernel Recursive ABC (Kajihara et al. 2018)
    • Point estimators inspired by Bertl et al. 2017 (Kernel), Jiang et al. 2018 (KL-Divergence), Briol et al. 2019 (Maximum Discrepancy Distance), Székely and Rizzo (Energy Distance)

API

model(params) = ...
setup = method(prior = ..., kwargs...)
result = run!(setup, model, data; kwargs...)

Features

  • Additional Distributions
    • MultivariateUniform
    • TruncatedMultivariateNormal
  • extensions of corrplot and histogram

Propositions

There is a little bit of overlap between the packages, but overall they seem fairly complementary. However, from a user perspective I think it would be awesome, if there would be a common API, such that one can easily switch between the different packages. I imagine in particular one way to define priors, models, metrics and fitting.

ABCBase.jl: a common API and some basic utilities

My proposition here is to write together a very light-weight ABCBase.jl package that serves as a primary dependency of ABC packages. See for example DiffEqBase.jl or ReinforcementLearningBase.jl for how this is done in other eco-systems. I would include in ABCBase.jl

Ingredients

  • everything related to prior distributions
  • everything related to summary statistics
  • everything related to metrics
  • testing (and possibly assertion) utilities
  • a well-written documentation of the common API

API

My proposition for the API is the following (I am biased of course, and I am very open to discussion!)

Additional to everything related to priors, summarys stats and metrics,
ABCBase.jl exports a function fit! with the following signature

fit!(setup, model, data; verbosity = 0, callback = () -> nothing, rng = Random.GLOBAL_RNG)

Every ABC package that relies on ABCBase.jl extends this fit! function, e.g.

ABCBase.fit!(method::RejectionABC, model, data; kwargs...) = "blabla"

The user provides models as callable objects (functions or functors) with one argument.
Constants are recommended to be handled with closures.
Extraction of summary statistics is done in the model.
For example

model(params) = "do something with params"

my_complex_model(params, constants) = "do something with params and constants"
model(params) = let constants = "blabla" my_complex_model(params, constants) end

my_raw_model(params) = "returns some raw data"
model(params) = extract_summary_statistics(my_raw_model(params))

struct MyFunctorModel
    options
end
(m::MyFunctorModel)(params) = "do something with m and params"

ABC methods/plans/setups are specified in the form

setup = method(metric = my_metric, kwargs...)
setup = method(prior = my_prior, kwargs...) # if method has a prior

One master packages to access all methods

Similar in spirit to DifferentialEquations.jl we could create one package that aggregates all packages and gives unified access. The dependency graph would be something like

            ABCBase.jl
                |
     -----------------------
    |           |          |
 ABCPkg1     ABCPkg2      etc.
    |           |          |
    ------------------------
                |
              ABC.jl

This package does nothing but reexport all the setups/methods defined in the
different packages and the fit! function. The name of this package should of course be discussed.

ABCProblems.jl

I think it would be nice to have a package with typical ABC benchmark problems,
like the stochastic lotka-volterra problem, the blowfly problem etc. Maybe we
could collect them in a package ABCProblems.jl.

New methods to be implemented

Here is an incomplete list of methods that I would love to see implemented in
julia. Together with a collection of benchmark problems one would get a nice box
to benchmark new methods we do research on.

Conclusions and Questions

Who would be up for such a collaborative effort?
How do you like my proposition for ABCBase.jl? What would you change?
Shall we create ABCBase.jl, ABCProblems.jl and ABC.jl? Or something similar with different names?

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.