Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ All notable changes to this project will be documented in this file.
- [#1432](https://github.com/pints-team/pints/pull/1432) Added 2 new stochastic models: production and degradation model, Schlogl's system of chemical reactions. Moved the stochastic logistic model into `pints.stochastic` to take advantage of the `MarkovJumpModel`.
- [#1420](https://github.com/pints-team/pints/pull/1420) The `Optimiser` class now distinguishes between a best-visited point (`x_best`, with score `f_best`) and a best-guessed point (`x_guessed`, with approximate score `f_guessed`). For most optimisers, the two values are equivalent. The `OptimisationController` still tracks `x_best` and `f_best` by default, but this can be modified using the methods `set_f_guessed_tracking` and `f_guessed_tracking`.
- [#1417](https://github.com/pints-team/pints/pull/1417) Added a module `toy.stochastic` for stochastic models. In particular, `toy.stochastic.MarkovJumpModel` implements Gillespie's algorithm for easier future implementation of stochastic models.
- [#1413](https://github.com/pints-team/pints/pull/1413) Added classes `pints.ABCController` and `pints.ABCSampler` for Approximate Bayesian computation (ABC) samplers. Added `pints.RejectionABC` which implements a simple rejection ABC sampling algorithm.

### Changed
- [#1439](https://github.com/pints-team/pints/pull/1439), [#1433](https://github.com/pints-team/pints/pull/1433) PINTS is no longer tested on Python 3.5. Testing for Python 3.10 has been added.
Expand Down
8 changes: 8 additions & 0 deletions docs/source/abc_samplers/base_classes.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
**********************
ABC sampler base class
**********************

.. currentmodule:: pints

.. autoclass:: ABCSampler
.. autoclass:: ABCController
16 changes: 16 additions & 0 deletions docs/source/abc_samplers/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
************
ABC samplers
************

.. currentmodule:: pints

Pints provides a number of samplers for Approximate Bayesian
Computation (ABC), all implementing the :class:`ABCSampler`
interface, that can be used to sample from a stochastic model
given a :class:`LogPrior` and a :class:`ErrorMeasure`.


.. toctree::

base_classes
rejection_abc
7 changes: 7 additions & 0 deletions docs/source/abc_samplers/rejection_abc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
*********************
Rejection ABC sampler
*********************

.. currentmodule:: pints

.. autoclass:: RejectionABC
7 changes: 4 additions & 3 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Contents

.. toctree::

abc_samplers/index
boundaries
core_classes_and_methods
diagnostics
Expand Down Expand Up @@ -78,10 +79,10 @@ Sampling

- SMC

#. Likelihood free sampling (Need distance between data and states, e.g. least squares?)
#. :class:`ABC sampling<ABCSampler>`

- ABC-MCMC
- ABC-SMC
- :class:`RejectionABC`, requires a :class:`LogPrior` that can be sampled
from and an error measure.

#. 1st order sensitivity MCMC samplers (Need derivatives of :class:`LogPDF`)

Expand Down
3 changes: 3 additions & 0 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ relevant code.
- [Ellipsoidal nested sampling](./sampling/nested-ellipsoidal-sampling.ipynb)
- [Rejection nested sampling](./sampling/nested-rejection-sampling.ipynb)

### ABC
- [Rejection ABC sampling](./sampling/rejection-abc.ipynb)

### Analysing sampling results
- [Autocorrelation](./plotting/mcmc-autocorrelation.ipynb)
- [Customise analysis plots](./plotting/customise-pints-plots.ipynb)
Expand Down
243 changes: 243 additions & 0 deletions examples/sampling/rejection-abc.ipynb

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions pints/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,11 +236,20 @@ def version(formatted=False):
from ._nested._ellipsoid import NestedEllipsoidSampler


#
# ABC
#
from ._abc import ABCSampler
from ._abc import ABCController
from ._abc._abc_rejection import RejectionABC


#
# Sampling initialising
#
from ._sample_initial_points import sample_initial_points


#
# Transformations
#
Expand Down
Loading