TransportMaps.Distributions.Inference.InferenceBase
¶
Module Contents¶
Classes¶
Given a log-likelihood and a prior, assemble the posterior density |
- class TransportMaps.Distributions.Inference.InferenceBase.BayesPosteriorDistribution(logL, prior)[source]¶
Bases:
TransportMaps.Distributions.Distribution
Given a log-likelihood and a prior, assemble the posterior density
Given the log-likelihood \(\log\pi({\bf y}\vert{\bf x})\) and the prior density \(\pi({\bf x})\), assemble the Bayes’ posterior density
\[\pi({\bf x}\vert {\bf y}) \propto \pi({\bf y}\vert{\bf x}) \pi({\bf x})\]- Parameters:
logL (
LogLikelihood
) – log-likelihood \(\log\pi({\bf y}\vert{\bf x})\)prior (
Distribution
) – prior density \(\pi({\bf x})\)
- log_pdf(x, idxs_slice=slice(None, None, None), cache=None, **kwargs)[source]¶
Evaluate \(\log \pi({\bf x}\vert{\bf y})\)
- Parameters:
- Returns:
- (
ndarray
[\(m\)]) – values of \(\log\pi\) at the
x
points.
- (
- grad_x_log_pdf(x, idxs_slice=slice(None, None, None), cache=None, **kwargs)[source]¶
Evaluate \(\nabla_{\bf x} \log \pi({\bf x}\vert{\bf y})\)
- Parameters:
- Returns:
- (
ndarray
[\(m,d\)]) – values of \(\nabla_{\bf x}\log\pi\) at the
x
points.
- (
- tuple_grad_x_log_pdf(x, idxs_slice=slice(None, None, None), cache=None, **kwargs)[source]¶
Evaluate \(\left(\log \pi({\bf x}\vert{\bf y}), \nabla_{\bf x} \log \pi({\bf x}\vert{\bf y})\right)\)
- Parameters:
- Returns:
- (
tuple
) – \(\left(\log \pi({\bf x}\vert{\bf y}), \nabla_{\bf x} \log \pi({\bf x}\vert{\bf y})\right)\)
- (
- hess_x_log_pdf(x, idxs_slice=slice(None, None, None), cache=None, **kwargs)[source]¶
Evaluate \(\nabla^2_{\bf x} \log \pi({\bf x}\vert{\bf y})\)
- Parameters:
- Returns:
- (
ndarray
[\(m,d,d\)]) – values of \(\nabla^2_{\bf x}\log\pi\) at the
x
points.
- (
- action_hess_x_log_pdf(x, dx, idxs_slice=slice(None, None, None), cache=None, **kwargs)[source]¶
Evaluate \(\langle\nabla^2_{\bf x} \log \pi({\bf x}\vert{\bf y}), \delta{\bf x}\rangle\)
- Parameters:
x (
ndarray
[\(m,d\)]) – evaluation pointsdx (
ndarray
[\(m,d\)]) – direction on which to evaluate the Hessianidxs_slice (slice) – if precomputed values are present, this parameter indicates at which of the points to evaluate. The number of indices represented by
idxs_slice
must matchx.shape[0]
.cache (dict) – cache
- Returns:
- (
ndarray
[\(m,d\)]) – values of \(\langle\nabla^2_{\bf x} \log \pi({\bf x}\vert{\bf y}), \delta{\bf x}\rangle\) at the
x
points.
- (