TransportMaps.Distributions.ConditionalDistributions
¶
Module Contents¶
Classes¶
Multivariate Gaussian distribution \(\pi({\bf x}\vert{\bf y}) \sim \mathcal{N}(\mu({\bf y}), \Sigma({\bf y}))\) |
|
Multivariate Gaussian distribution \(\pi({\bf x}\vert{\bf y}) \sim \mathcal{N}(\mu({\bf y}), \Sigma)\) |
Attributes¶
- class TransportMaps.Distributions.ConditionalDistributions.ConditionallyNormalDistribution(mu, sigma=None, precision=None, coeffs=None)[source]¶
Bases:
TransportMaps.Distributions.ConditionalDistributionBase.ConditionalDistribution
Multivariate Gaussian distribution \(\pi({\bf x}\vert{\bf y}) \sim \mathcal{N}(\mu({\bf y}), \Sigma({\bf y}))\)
- Parameters:
mu (
Map
) – mean vector mapsigma (
Map
) – covariance matrix mapprecision (
Map
) – precision matrix mapcoeffs (
ndarray
) – fix the coefficients \({\bf y}\)
- rvs(m, y=None, **kwargs)[source]¶
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
- log_pdf(x, y, params=None, idxs_slice=slice(None, None, None), cache=None)[source]¶
Evaluate \(\log \pi({\bf x}\vert{\bf y})\)
- Parameters:
x (
ndarray
[\(m,d\)]) – evaluation pointsy (
ndarray
[\(m,d_y\)] orndarray
[\(d_y\)]) – conditioning values \({\bf Y}={\bf y}\). In the second case one conditioning value is used for all the \(m\) points \({\bf x}\)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 (dict) – cache
- Returns:
- (
ndarray
[\(m\)]) – values of \(\log\pi\) at the
x
points.
- (
- grad_x_log_pdf(x, y, params=None, idxs_slice=slice(None, None, None), cache=None)[source]¶
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]
.cache (dict) – cache
- Returns:
- (
ndarray
[\(m,d\)]) – values of \(\nabla_x\log\pi\) at the
x
points.
- (
- class TransportMaps.Distributions.ConditionalDistributions.MeanConditionallyNormalDistribution(mu, sigma=None, precision=None, coeffs=None)[source]¶
Bases:
TransportMaps.Distributions.ConditionalDistributionBase.ConditionalDistribution
Multivariate Gaussian distribution \(\pi({\bf x}\vert{\bf y}) \sim \mathcal{N}(\mu({\bf y}), \Sigma)\)
- Parameters:
- rvs(m, y=None, **kwargs)[source]¶
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
- log_pdf(x, y, params=None, idxs_slice=slice(None, None, None), cache=None)[source]¶
Evaluate \(\log \pi({\bf x}\vert{\bf y})\)
- Parameters:
x (
ndarray
[\(m,d\)]) – evaluation pointsy (
ndarray
[\(m,d_y\)] orndarray
[\(d_y\)]) – conditioning values \({\bf Y}={\bf y}\). In the second case one conditioning value is used for all the \(m\) points \({\bf x}\)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 (dict) – cache
- Returns:
- (
ndarray
[\(m\)]) – values of \(\log\pi\) at the
x
points.
- (
- grad_x_log_pdf(x, y, params=None, idxs_slice=slice(None, None, None), cache=None)[source]¶
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]
.cache (dict) – cache
- Returns:
- (
ndarray
[\(m,d\)]) – values of \(\nabla_x\log\pi\) at the
x
points.
- (
- hess_x_log_pdf(x, y, params=None, idxs_slice=slice(None, None, None), cache=None)[source]¶
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]
.cache (dict) – cache
- Returns:
- (
ndarray
[\(m,d\)]) – values of \(\nabla^2_x\log\pi\) at the
x
points.
- (