Skip to content

Commit eb383e9

Browse files
committed
Reintroducing LogLikelihood class
1 parent 34e9b31 commit eb383e9

12 files changed

Lines changed: 649 additions & 578 deletions

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,17 @@ All notable changes to this project will be documented in this file.
66
## Unreleased
77

88
### Added
9+
- [#1724](https://github.com/pints-team/pints/pull/1724) Reintroduced the `LogLikelihood` class, to differentiate between probabilities of parameters and probabilities of data.
10+
- [#1724](https://github.com/pints-team/pints/pull/1724) Added `PooledLogLikelihood` and `SumOfIndependentLogLikelihoods`.
911
- [#1716](https://github.com/pints-team/pints/pull/1716) PINTS is now tested on Python 3.14.
1012
- [#1715](https://github.com/pints-team/pints/pull/1715) Added methods `ProblemErrorMeasure.problem()`, `ProblemLogLikelihood.problem()`, `SingleOutputProblem.model()` and `MultiOutputProblem.model()`.
1113
- [#1508](https://github.com/pints-team/pints/pull/1508) Added a method `OptimisationController.set_parameter_tolerance` that allows methods to stop after a fixed number of iterations with no significant movement in parameter space.
1214
### Changed
15+
- [#1724](https://github.com/pints-team/pints/pull/1724) Several methods that accepted `LogPDF`s now specifically require `LogLikelihood`s (e.g. `LogPosterior`, `NestedController`).
1316
- [#1713](https://github.com/pints-team/pints/pull/1713) PINTS now requires matplotlib 2.2 or newer.
1417
### Deprecated
1518
- [#1508](https://github.com/pints-team/pints/pull/1508) The methods `OptimisationController.max_unchanged_iterations` and `set_max_unchanged_iterations` are deprecated, in favour of `function_tolerance` and `set_function_tolerance` respectively.
19+
- [#1724](https://github.com/pints-team/pints/pull/1724) The classes `PooledLogPDF` and `SumOfIndependentLogPDFs` are deprecated, in favour of `PooledLogLikelihood` and `SumOfIndependentLogLikelihoods` respectively.
1620
### Removed
1721
### Fixed
1822
- [#1713](https://github.com/pints-team/pints/pull/1713) Fixed Numpy 2.4.1 compatibility issues.

docs/source/index.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@ Sampling
9595
- :class:`No U-Turn Sampler with dual averaging (NUTS) <NoUTurnMCMC>`
9696
- :class:`RelativisticMCMC`
9797

98-
#. :class:`Nested sampling<NestedSampler>`, require a :class:`LogPDF` and a
99-
:class:`LogPrior` that can be sampled from.
98+
#. :class:`Nested sampling<NestedSampler>`, require a :class:`LogLikelihood`
99+
and a :class:`LogPrior` that can be sampled from.
100100

101101
- :class:`NestedEllipsoidSampler`
102102
- :class:`NestedRejectionSampler`

docs/source/log_likelihoods.rst

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,17 @@ Log-likelihoods
44

55
.. currentmodule:: pints
66

7-
The classes below all implement the :class:`ProblemLogLikelihood` interface,
8-
and can calculate a log-likelihood based on some time-series :class:`Problem`
9-
and an assumed noise model.
7+
The classes below all implement the :class:`LogLikelihood` interface.
8+
Most are :class:`ProblemLogLikelihood` implementations, which calculate a
9+
log-likelihood based on some time-series :class:`Problem` and an assumed noise
10+
model.
11+
Some are methods combining other likelihoods.
1012

1113
Example::
1214

13-
logpdf = pints.GaussianLogLikelihood(problem)
15+
log_likelihood = pints.GaussianLogLikelihood(problem)
1416
x = [1, 2, 3]
15-
fx = logpdf(x)
17+
fx = log_likelihood(x)
1618

1719

1820
.. autoclass:: AR1LogLikelihood
@@ -39,8 +41,17 @@ Example::
3941

4042
.. autoclass:: MultiplicativeGaussianLogLikelihood
4143

44+
.. autoclass:: PooledLogLikelihood
45+
46+
.. autoclass:: PooledLogPDF
47+
4248
.. autoclass:: ScaledLogLikelihood
4349

4450
.. autoclass:: StudentTLogLikelihood
4551

52+
.. autoclass:: SumOfIndependentLogLikelihoods
53+
54+
.. autoclass:: SumOfIndependentLogPDFs
55+
4656
.. autoclass:: UnknownNoiseLogLikelihood
57+

docs/source/log_pdfs.rst

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,9 @@ Example::
2020

2121
.. autoclass:: LogPrior
2222

23-
.. autoclass:: LogPosterior
24-
25-
.. autoclass:: PooledLogPDF
23+
.. autoclass:: LogLikelihood
2624

2725
.. autoclass:: ProblemLogLikelihood
2826

29-
.. autoclass:: SumOfIndependentLogPDFs
27+
.. autoclass:: LogPosterior
3028

pints/__init__.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,11 @@ def version(formatted=False):
7979
# Logs of probability density functions (not necessarily normalised)
8080
#
8181
from ._log_pdfs import (
82+
LogLikelihood,
8283
LogPDF,
8384
LogPrior,
8485
LogPosterior,
85-
PooledLogPDF,
8686
ProblemLogLikelihood,
87-
SumOfIndependentLogPDFs,
8887
)
8988

9089
#
@@ -124,8 +123,12 @@ def version(formatted=False):
124123
KnownNoiseLogLikelihood,
125124
LogNormalLogLikelihood,
126125
MultiplicativeGaussianLogLikelihood,
126+
PooledLogLikelihood,
127+
PooledLogPDF,
127128
ScaledLogLikelihood,
128129
StudentTLogLikelihood,
130+
SumOfIndependentLogLikelihoods,
131+
SumOfIndependentLogPDFs,
129132
UnknownNoiseLogLikelihood,
130133
)
131134

0 commit comments

Comments
 (0)