TransportMaps.Distributions.ConditionalDistributionBase
¶
Module Contents¶
Classes¶
Abstract distribution \(\pi_{{\bf X}\vert{\bf Y}}\). |
- class TransportMaps.Distributions.ConditionalDistributionBase.ConditionalDistribution(dim, dim_y)[source]¶
Bases:
TransportMaps.Distributions.DistributionBase.Distribution
Abstract distribution \(\pi_{{\bf X}\vert{\bf Y}}\).
- Parameters:
- abstract rvs(m, y, *args, **kwargs)[source]¶
[Abstract] Generate \(m\) samples from the distribution.
- Parameters:
- Returns:
- (
ndarray
[\(m,d\)]) – \(m\) \(d\)-dimensional samples
- (
- Raises:
NotImplementedError – the method needs to be defined in the sub-classes
- abstract quadrature(qtype, qparams, y, mass, *args, **kwargs)[source]¶
[Abstract] Generate quadrature points and weights.
- Parameters:
qtype (int) – quadrature type number. The different types are defined in the associated sub-classes.
qparams (object) – inputs necessary to the generation of the selected quadrature
y (
ndarray
[\(d_y\)]) – conditioning values \({\bf Y}={\bf y}\)mass (float) – total mass of the quadrature (1 for probability measures)
- Returns:
- Raises:
NotImplementedError – the method needs to be defined in the sub-classes
- pdf(x, y, params=None, idxs_slice=slice(None, None, None), cache=None)[source]¶
Evaluate \(\pi({\bf x})\)
- Parameters:
x (
ndarray
[\(m,d\)]) – evaluation pointsy (
ndarray
[\(d_y\)]) – conditioning values \({\bf Y}={\bf y}\)params (dict) – parameters
idxs_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 (dist) – cache
- Returns:
- (
ndarray
[\(m\)]) – values of \(\pi\) at the
x
points.
- (
- Raises:
NotImplementedError – the method calls :fun:`log_pdf`
- abstract log_pdf(x, y, params=None, idxs_slice=slice(None, None, None), **kwargs)[source]¶
[Abstract] Evaluate \(\log \pi({\bf x}\vert{\bf y})\)
- Parameters:
x (
ndarray
[\(m,d\)]) – evaluation pointsy (
ndarray
[\(m,d_y\)]) – conditioning values \({\bf Y}={\bf y}\)params (dict) – parameters
idxs_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]
.
- Returns:
- (
ndarray
[\(m\)]) – values of \(\log\pi\) at the
x
points.
- (
- Raises:
NotImplementedError – the method needs to be defined in the sub-classes
- abstract grad_x_log_pdf(x, y, params=None, idxs_slice=slice(None, None, None), **kwargs)[source]¶
[Abstract] Evaluate \(\nabla_{\bf x,y} \log \pi({\bf x}\vert{\bf y})\)
- Parameters:
x (
ndarray
[\(m,d\)]) – evaluation pointsy (
ndarray
[\(m,d_y\)]) – conditioning values \({\bf Y}={\bf y}\)params (dict) – parameters
idxs_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]
.
- Returns:
- (
ndarray
[\(m,d\)]) – values of \(\nabla_x\log\pi\) at the
x
points.
- (
- Raises:
NotImplementedError – the method needs to be defined in the sub-classes
- tuple_grad_x_log_pdf(x, y, params=None, idxs_slice=slice(None, None, None), cache=None, **kwargs)[source]¶
Evaluate \(\left(\log \pi({\bf x}\vert{\bf y}), \nabla_{\bf x,y} \log \pi({\bf x}\vert{\bf y})\right)\)
- Parameters:
x (
ndarray
[\(m,d\)]) – evaluation pointsy (
ndarray
[\(m,d_y\)]) – conditioning values \({\bf Y}={\bf y}\)params (dict) – parameters
idxs_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 (dist) – cache
- Returns:
- (
tuple
) – containing \(\left(\log \pi({\bf x}\vert{\bf y}), \nabla_{\bf x,y} \log \pi({\bf x}\vert{\bf y})\right)\)
- (
- Raises:
NotImplementedError – the method needs to be defined in the sub-classes
- abstract hess_x_log_pdf(x, y, params=None, idxs_slice=slice(None, None, None), **kwargs)[source]¶
[Abstract] Evaluate \(\nabla^2_{\bf x,y} \log \pi({\bf x}\vert{\bf y})\)
- Parameters:
x (
ndarray
[\(m,d\)]) – evaluation pointsy (
ndarray
[\(m,d_y\)]) – conditioning values \({\bf Y}={\bf y}\)params (dict) – parameters
idxs_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]
.
- Returns:
- (
ndarray
[\(m,d,d\)]) – values of \(\nabla^2_x\log\pi\) at the
x
points.
- (
- Raises:
NotImplementedError – the method needs to be defined in the sub-classes
- abstract action_hess_x_log_pdf(x, y, dx, dy, params=None, idxs_slice=slice(None, None, None), **kwargs)[source]¶
[Abstract] Evaluate \(\langle\nabla^2_{\bf x,y} \log \pi({\bf x}\vert{\bf y}), [\delta{\bf x},\delta{\bf y}]\rangle\)
- Parameters:
x (
ndarray
[\(m,d\)]) – evaluation pointsy (
ndarray
[\(m,d_y\)]) – conditioning values \({\bf Y}={\bf y}\)dx (
ndarray
[\(m,d\)]) –x
direction on which to evaluate the Hessiandy (
ndarray
[\(m,d_y\)]) –y
direction on which to evaluate the Hessianparams (dict) – parameters
idxs_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]
.
- Returns:
- (
ndarray
[\(m,d,d\)]) – values of \(\nabla^2_x\log\pi\) at the
x
points.
- (
- Raises:
NotImplementedError – the method needs to be defined in the sub-classes
- abstract mean_log_pdf(y)[source]¶
[Abstract] Evaluate \(\mathbb{E}_{\pi}[\log \pi]\)
- Parameters:
y (
ndarray
[\(d_y\)]) – conditioning values \({\bf Y}={\bf y}\)- Returns:
(float) – \(\mathbb{E}_{\pi}[\log \pi]\)
- Raises:
NotImplementedError – the method needs to be defined in the sub-classes