TransportMaps.Distributions.FrozenDistributions
¶
Module Contents¶
Classes¶
[Abstract] Generic frozen distribution 1d |
|
Multivariate Standard Normal distribution \(\pi\). |
|
Multivariate Gaussian distribution \(\mathcal{N}(\mu,\Sigma)\) |
|
Multivariate Gaussian distribution \(\pi\) |
|
Multivariate Gaussian distribution \(\pi\) |
|
Multivariate Gaussian distribution \(\pi\) |
|
[Abstract] Generic frozen distribution 1d |
|
[Abstract] Generic frozen distribution 1d |
|
[Abstract] Generic frozen distribution 1d |
|
[Abstract] Generic frozen distribution 1d |
|
Abstract distribution \(\nu_\pi\). |
|
[Abstract] Generic frozen distribution 1d |
|
[Abstract] Generic frozen distribution 1d |
|
[Abstract] Generic frozen distribution 1d |
|
[Abstract] Generic frozen distribution 1d |
|
Class for densities of the transport map type \(T_\sharp \pi\) |
- class TransportMaps.Distributions.FrozenDistributions.FrozenDistribution_1d[source]¶
Bases:
TransportMaps.Distributions.DistributionBase.Distribution
[Abstract] Generic frozen distribution 1d
- rvs(n, *args, **kwargs)[source]¶
[Abstract] Generate \(m\) samples from the distribution.
- Parameters:
m (int) – number of samples to generate
- Returns:
- (
ndarray
[\(m,d\)]) – \(m\) \(d\)-dimensional samples
- (
- Raises:
NotImplementedError – the method needs to be defined in the sub-classes
- quadrature(qtype, qparams, mass=1, **kwargs)[source]¶
Generate quadrature points and weights.
Types of quadratures:
- Monte-Carlo (
qtype==0
) qparams
: (int
) – number of samples- Quasi-Monte-Carlo (
qtype==1
) qparams
: (int
) – number of samples- Latin-Hypercube-Sampling (
qtype==2
) qparams
: (int
) – number of samples- Gauss-quadrature (
qtype==3
) qparams
: (list
[\(d\)]) – orders for each dimension- Sparse Grid Gauss-Hermite quadrature (
qtype==4
) qparams
: (list
[\(d\)]) – orders for each dimension
See also
Distribution.quadrature()
- Monte-Carlo (
- tuple_grad_x_log_pdf(x, *args, **kwargs)[source]¶
[Abstract] Compute the tuple \(\left(\log \pi({\bf x}), \nabla_{\bf x} \log \pi({\bf x})\right)\)
- Parameters:
- Returns:
- (
tuple
) – containing \(\left(\log \pi({\bf x}), \nabla_{\bf x} \log \pi({\bf x})\right)\)
- (
- Raises:
NotImplementedError – the method needs to be defined in the sub-classes
- action_hess_x_log_pdf(x, dx, *args, **kwargs)[source]¶
[Abstract] Evaluate \(\langle \nabla^2_{\bf x} \log \pi({\bf x}), \delta{\bf x}\rangle\)
- Parameters:
x (
ndarray
[\(m,d\)]) – evaluation pointsdx (
ndarray
[\(m,d\)]) – 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\)]) – values of \(\langle \nabla^2_{\bf x} \log \pi({\bf x}), \delta{\bf x}\rangle\).
- (
- Raises:
NotImplementedError – the method needs to be defined in the sub-classes
- class TransportMaps.Distributions.FrozenDistributions.StandardNormalDistribution(dim)[source]¶
Bases:
TransportMaps.Distributions.ProductDistributionBase.ProductDistribution
Multivariate Standard Normal distribution \(\pi\).
- Parameters:
d (int) – dimension
- rvs(m, *args, **kwargs)[source]¶
Generate \(m\) samples from the distribution.
See also
Distribution.rvs()
- quadrature(qtype, qparams, mass=1.0, batch_size=np.inf, **kwargs)[source]¶
Generate quadrature points and weights.
Types of quadratures:
- Monte-Carlo (
qtype==0
) qparams
: (int
) – number of samples- Quasi-Monte-Carlo (
qtype==1
) qparams
: (int
) – number of samples- Latin-Hypercube-Sampling (
qtype==2
) qparams
: (int
) – number of samples- Gauss-quadrature (
qtype==3
) qparams
: (list
[\(d\)]) – orders for each dimension- Sparse Grid Gauss-Hermite quadrature (
qtype==4
) qparams
: (list
[\(d\)]) – orders for each dimension
See also
Distribution.quadrature()
- Monte-Carlo (
- get_component(avars)[source]¶
Return the measure \(\nu_{a_1}\times\cdots\times\nu_{a_k} = \mathcal{N}(0,{\bf I}_k)\)
- Parameters:
avars (list) – list of coordinates to extract from \(\nu\)
- grad_x_log_pdf(x, *args, **kwargs)[source]¶
Evaluate \(\nabla_{\bf x}\log\pi({\bf x})\)
See also
Distribution.grad_x_log_pdf()
- tuple_grad_x_log_pdf(x, *args, **kwargs)[source]¶
Evaluate \((\log\pi({\bf x}), \nabla_{\bf x}\log\pi({\bf x}))\)
See also
Distribution.grad_x_log_pdf()
- hess_x_log_pdf(x, *args, **kwargs)[source]¶
Evaluate \(\nabla^2_{\bf x}\log\pi({\bf x})\)
See also
Distribution.hess_x_log_pdf()
- action_hess_x_log_pdf(x, dx, *args, **kwargs)[source]¶
Evaluate \(\langle \nabla^2_{\bf x}\log\pi({\bf x}), \delta{\bf x}\rangle\)
See also
Distribution.action_hess_x_log_pdf()
- solve_square_root(y)[source]¶
Solve \(\Sigma^{\frac{1}{2}}{\bf x} = {\bf y}\) (\({\bf x}={\bf y}\) for Standard Normal).
- solve_square_root_transpose(y)[source]¶
Solve \(\Sigma^{\frac{\top}{2}}{\bf x} = {\bf y}\) (\({\bf x}={\bf y}\) for Standard Normal).
- class TransportMaps.Distributions.FrozenDistributions.NormalDistribution(mu, covariance=None, precision=None, square_root_covariance=None, square_root_precision=None, square_root_type='sym')[source]¶
Bases:
TransportMaps.Distributions.TransportMapDistributions.PushForwardTransportMapDistribution
Multivariate Gaussian distribution \(\mathcal{N}(\mu,\Sigma)\)
- Parameters:
mu (
ndarray
[\(d\)]) – mean vector \(\mu\)covariance (
ndarray
[\(d,d\)]) – covariance matrix \(\Sigma\)precision (
ndarray
[\(d,d\)]) – precision matrix \(\Sigma^{-1}\)square_root_covariance (
ndarray
[\(d,d\)]) – square root \(\Sigma^{\frac{1}{2}}\)square_root_precision (
ndarray
[\(d,d\)]) – square root \(\Sigma^{-\frac{1}{2}}\)square_root_type (str) – type of square root to be used in case
covariance
orprecision``were provided. For ``square_root_type=='sym'
, \(L=U\Lambda^{\frac{1}{2}}U^T\) where \(\Sigma = U\Lambda U^T\) is the eigenvalue decomposition of \(\Sigma\). Forsquare_root_type=='tri'
orsquare_root_type=='chol'
, :maht:`L=C` where \(\Sigma=CC^T\) is the Cholesky decomposition of \(\Sigma\). Forsquare_root_type=='kl'
, \(L=U\Lambda^{\frac{1}{2}}\) where \(\Sigma = U\Lambda U^T\) is the eigenvalue decomposition of \(\Sigma\) (this corresponds to the Karuenen-Loeve expansion). The eigenvalues and eigenvectors are ordered with \(\lambda_i\geq\lambda_{i+1}\). If the parametersquare_root
is provided, then thesquare_root_type
attribute will be setuser
.
Note
The arguments
covariance
,precision
andsquare_root
are mutually exclusive.- _square_root_covariance_from_covariance(square_root_type='sym')[source]¶
Factorizes the covariance and returns its square root
- Kwargs:
- square_root_type (str): type of square root.
For
square_root_type=='sym'
, \(L=U\Lambda^{\frac{1}{2}}U^T\) where \(\Sigma = U\Lambda U^T\) is the eigenvalue decomposition of \(\Sigma\). Forsquare_root_type=='tri'
orsquare_root_type=='chol'
, :maht:`L=C` where \(\Sigma=CC^T\) is the Cholesky decomposition of \(\Sigma\). Forsquare_root_type=='kl'
, \(L=U\Lambda^{\frac{1}{2}}\) where \(\Sigma = U\Lambda U^T\) is the eigenvalue decomposition of \(\Sigma\) (this corresponds to the Karuenen-Loeve expansion). The eigenvalues and eigenvectors are ordered with \(\lambda_i\geq\lambda_{i+1}\).
- Returns:
\(L\) – square root of covariance
- _square_root_precision_from_covariance(square_root_type='sym')[source]¶
Factorizes the covariance and returns the square root of the precision
- Kwargs:
- square_root_type (str): type of square root.
For
square_root_type=='sym'
, \(L=U\Lambda^{\frac{1}{2}}U^T\) where \(\Sigma = U\Lambda U^T\) is the eigenvalue decomposition of \(\Sigma\). Forsquare_root_type=='tri'
orsquare_root_type=='chol'
, :maht:`L=C` where \(\Sigma=CC^T\) is the Cholesky decomposition of \(\Sigma\). Forsquare_root_type=='kl'
, \(L=U\Lambda^{\frac{1}{2}}\) where \(\Sigma = U\Lambda U^T\) is the eigenvalue decomposition of \(\Sigma\) (this corresponds to the Karuenen-Loeve expansion). The eigenvalues and eigenvectors are ordered with \(\lambda_i\geq\lambda_{i+1}\).
- Returns:
\(L^{-1}\) – square root of precision
- _square_root_precision_from_precision(square_root_type='sym')[source]¶
Factorizes the precision and returns its square root
- Parameters:
precision (
ndarray
[\(d,d\)]) – precision matrix \(\Sigma^{-1}\)
- Kwargs:
- square_root_type (str): type of square root.
For
square_root_type=='sym'
, \(L=U\Lambda^{\frac{1}{2}}U^T\) where \(\Sigma = U\Lambda U^T\) is the eigenvalue decomposition of \(\Sigma\). Forsquare_root_type=='tri'
orsquare_root_type=='chol'
, :maht:`L=C` where \(\Sigma=CC^T\) is the Cholesky decomposition of \(\Sigma\). Forsquare_root_type=='kl'
, \(L=U\Lambda^{\frac{1}{2}}\) where \(\Sigma = U\Lambda U^T\) is the eigenvalue decomposition of \(\Sigma\) (this corresponds to the Karuenen-Loeve expansion). The eigenvalues and eigenvectors are ordered with \(\lambda_i\geq\lambda_{i+1}\).
- Returns:
\(L^{-1}\) – square root of the precision
- _square_root_covariance_from_precision(square_root_type='sym')[source]¶
Factorizes the precision and returns the square root of the covariance
- Parameters:
precision (
ndarray
[\(d,d\)]) – precision matrix \(\Sigma^{-1}\)
- Kwargs:
- square_root_type (str): type of square root.
For
square_root_type=='sym'
, \(L=U\Lambda^{\frac{1}{2}}U^T\) where \(\Sigma = U\Lambda U^T\) is the eigenvalue decomposition of \(\Sigma\). Forsquare_root_type=='tri'
orsquare_root_type=='chol'
, :maht:`L=C` where \(\Sigma=CC^T\) is the Cholesky decomposition of \(\Sigma\). Forsquare_root_type=='kl'
, \(L=U\Lambda^{\frac{1}{2}}\) where \(\Sigma = U\Lambda U^T\) is the eigenvalue decomposition of \(\Sigma\) (this corresponds to the Karuenen-Loeve expansion). The eigenvalues and eigenvectors are ordered with \(\lambda_i\geq\lambda_{i+1}\).
- Returns:
\(L\) – square root of the covariance
- solve_square_root_covariance_transposed(y)[source]¶
Solve \(\Sigma^{\frac{\top}{2}}{\bf x} = {\bf y}\).
- class TransportMaps.Distributions.FrozenDistributions.ChainGraphGaussianDistribution(dim, edge_strength=0.45)[source]¶
Bases:
TransportMaps.Distributions.Deprecated.GaussianDistribution
Multivariate Gaussian distribution \(\pi\)
- Parameters:
- class TransportMaps.Distributions.FrozenDistributions.StarGraphGaussianDistribution(dim, edge_strength=0.45)[source]¶
Bases:
TransportMaps.Distributions.Deprecated.GaussianDistribution
Multivariate Gaussian distribution \(\pi\)
- Parameters:
- class TransportMaps.Distributions.FrozenDistributions.GridGraphGaussianDistribution(dim, edge_strength=1.0)[source]¶
Bases:
TransportMaps.Distributions.Deprecated.GaussianDistribution
Multivariate Gaussian distribution \(\pi\)
- Parameters:
- class TransportMaps.Distributions.FrozenDistributions.LogNormalDistribution(s, mu, scale)[source]¶
Bases:
FrozenDistribution_1d
[Abstract] Generic frozen distribution 1d
- rvs(n, *args, **kwargs)[source]¶
[Abstract] Generate \(m\) samples from the distribution.
- Parameters:
m (int) – number of samples to generate
- Returns:
- (
ndarray
[\(m,d\)]) – \(m\) \(d\)-dimensional samples
- (
- Raises:
NotImplementedError – the method needs to be defined in the sub-classes
- pdf(x, *args, **kwargs)[source]¶
Evaluate \(\pi({\bf x})\)
- Parameters:
- Returns:
- (
ndarray
[\(m\)]) – values of \(\pi\) at the
x
points.
- (
- Raises:
NotImplementedError – the method calls :fun:`log_pdf`
- log_pdf(x, *args, **kwargs)[source]¶
[Abstract] Evaluate \(\log \pi({\bf x})\)
- Parameters:
- Returns:
- (
ndarray
[\(m\)]) – values of \(\log\pi\) at the
x
points.
- (
- Raises:
NotImplementedError – the method needs to be defined in the sub-classes
- grad_x_log_pdf(x, *args, **kwargs)[source]¶
[Abstract] Evaluate \(\nabla_{\bf x} \log \pi({\bf x})\)
- Parameters:
- 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
- hess_x_log_pdf(x, *args, **kwargs)[source]¶
[Abstract] Evaluate \(\nabla^2_{\bf x} \log \pi({\bf x})\)
- Parameters:
- 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
- class TransportMaps.Distributions.FrozenDistributions.LogisticDistribution(mu, s)[source]¶
Bases:
FrozenDistribution_1d
[Abstract] Generic frozen distribution 1d
- rvs(n, *args, **kwargs)[source]¶
[Abstract] Generate \(m\) samples from the distribution.
- Parameters:
m (int) – number of samples to generate
- Returns:
- (
ndarray
[\(m,d\)]) – \(m\) \(d\)-dimensional samples
- (
- Raises:
NotImplementedError – the method needs to be defined in the sub-classes
- pdf(x, *args, **kwargs)[source]¶
Evaluate \(\pi({\bf x})\)
- Parameters:
- Returns:
- (
ndarray
[\(m\)]) – values of \(\pi\) at the
x
points.
- (
- Raises:
NotImplementedError – the method calls :fun:`log_pdf`
- log_pdf(x, *args, **kwargs)[source]¶
[Abstract] Evaluate \(\log \pi({\bf x})\)
- Parameters:
- Returns:
- (
ndarray
[\(m\)]) – values of \(\log\pi\) at the
x
points.
- (
- Raises:
NotImplementedError – the method needs to be defined in the sub-classes
- grad_x_log_pdf(x, *args, **kwargs)[source]¶
[Abstract] Evaluate \(\nabla_{\bf x} \log \pi({\bf x})\)
- Parameters:
- 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
- hess_x_log_pdf(x, *args, **kwargs)[source]¶
[Abstract] Evaluate \(\nabla^2_{\bf x} \log \pi({\bf x})\)
- Parameters:
- 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
- class TransportMaps.Distributions.FrozenDistributions.GammaDistribution(kappa, theta)[source]¶
Bases:
FrozenDistribution_1d
[Abstract] Generic frozen distribution 1d
- rvs(n, *args, **kwargs)[source]¶
[Abstract] Generate \(m\) samples from the distribution.
- Parameters:
m (int) – number of samples to generate
- Returns:
- (
ndarray
[\(m,d\)]) – \(m\) \(d\)-dimensional samples
- (
- Raises:
NotImplementedError – the method needs to be defined in the sub-classes
- pdf(x, *args, **kwargs)[source]¶
Evaluate \(\pi({\bf x})\)
- Parameters:
- Returns:
- (
ndarray
[\(m\)]) – values of \(\pi\) at the
x
points.
- (
- Raises:
NotImplementedError – the method calls :fun:`log_pdf`
- log_pdf(x, *args, **kwargs)[source]¶
[Abstract] Evaluate \(\log \pi({\bf x})\)
- Parameters:
- Returns:
- (
ndarray
[\(m\)]) – values of \(\log\pi\) at the
x
points.
- (
- Raises:
NotImplementedError – the method needs to be defined in the sub-classes
- grad_x_log_pdf(x, *args, **kwargs)[source]¶
[Abstract] Evaluate \(\nabla_{\bf x} \log \pi({\bf x})\)
- Parameters:
- 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
- hess_x_log_pdf(x, *args, **kwargs)[source]¶
[Abstract] Evaluate \(\nabla^2_{\bf x} \log \pi({\bf x})\)
- Parameters:
- 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
- class TransportMaps.Distributions.FrozenDistributions.BetaDistribution(alpha, beta)[source]¶
Bases:
FrozenDistribution_1d
[Abstract] Generic frozen distribution 1d
- rvs(n, *args, **kwargs)[source]¶
[Abstract] Generate \(m\) samples from the distribution.
- Parameters:
m (int) – number of samples to generate
- Returns:
- (
ndarray
[\(m,d\)]) – \(m\) \(d\)-dimensional samples
- (
- Raises:
NotImplementedError – the method needs to be defined in the sub-classes
- pdf(x, *args, **kwargs)[source]¶
Evaluate \(\pi({\bf x})\)
- Parameters:
- Returns:
- (
ndarray
[\(m\)]) – values of \(\pi\) at the
x
points.
- (
- Raises:
NotImplementedError – the method calls :fun:`log_pdf`
- log_pdf(x, *args, **kwargs)[source]¶
[Abstract] Evaluate \(\log \pi({\bf x})\)
- Parameters:
- Returns:
- (
ndarray
[\(m\)]) – values of \(\log\pi\) at the
x
points.
- (
- Raises:
NotImplementedError – the method needs to be defined in the sub-classes
- grad_x_log_pdf(x, *args, **kwargs)[source]¶
[Abstract] Evaluate \(\nabla_{\bf x} \log \pi({\bf x})\)
- Parameters:
- 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
- hess_x_log_pdf(x, *args, **kwargs)[source]¶
[Abstract] Evaluate \(\nabla^2_{\bf x} \log \pi({\bf x})\)
- Parameters:
- 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
- class TransportMaps.Distributions.FrozenDistributions.UniformDistribution(dim=1)[source]¶
Bases:
TransportMaps.Distributions.DistributionBase.Distribution
Abstract distribution \(\nu_\pi\).
- rvs(n, *args, **kwargs)[source]¶
[Abstract] Generate \(m\) samples from the distribution.
- Parameters:
m (int) – number of samples to generate
- Returns:
- (
ndarray
[\(m,d\)]) – \(m\) \(d\)-dimensional samples
- (
- Raises:
NotImplementedError – the method needs to be defined in the sub-classes
- pdf(x, *args, **kwargs)[source]¶
Evaluate \(\pi({\bf x})\)
- Parameters:
- Returns:
- (
ndarray
[\(m\)]) – values of \(\pi\) at the
x
points.
- (
- Raises:
NotImplementedError – the method calls :fun:`log_pdf`
- log_pdf(x, *args, **kwargs)[source]¶
[Abstract] Evaluate \(\log \pi({\bf x})\)
- Parameters:
- Returns:
- (
ndarray
[\(m\)]) – values of \(\log\pi\) at the
x
points.
- (
- Raises:
NotImplementedError – the method needs to be defined in the sub-classes
- grad_x_log_pdf(x, *args, **kwargs)[source]¶
[Abstract] Evaluate \(\nabla_{\bf x} \log \pi({\bf x})\)
- Parameters:
- 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
- hess_x_log_pdf(x, *args, **kwargs)[source]¶
[Abstract] Evaluate \(\nabla^2_{\bf x} \log \pi({\bf x})\)
- Parameters:
- 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
- class TransportMaps.Distributions.FrozenDistributions.GumbelDistribution(mu, beta)[source]¶
Bases:
FrozenDistribution_1d
[Abstract] Generic frozen distribution 1d
- rvs(n, *args, **kwargs)[source]¶
[Abstract] Generate \(m\) samples from the distribution.
- Parameters:
m (int) – number of samples to generate
- Returns:
- (
ndarray
[\(m,d\)]) – \(m\) \(d\)-dimensional samples
- (
- Raises:
NotImplementedError – the method needs to be defined in the sub-classes
- pdf(x, *args, **kwargs)[source]¶
Evaluate \(\pi({\bf x})\)
- Parameters:
- Returns:
- (
ndarray
[\(m\)]) – values of \(\pi\) at the
x
points.
- (
- Raises:
NotImplementedError – the method calls :fun:`log_pdf`
- log_pdf(x, *args, **kwargs)[source]¶
[Abstract] Evaluate \(\log \pi({\bf x})\)
- Parameters:
- Returns:
- (
ndarray
[\(m\)]) – values of \(\log\pi\) at the
x
points.
- (
- Raises:
NotImplementedError – the method needs to be defined in the sub-classes
- grad_x_log_pdf(x, *args, **kwargs)[source]¶
[Abstract] Evaluate \(\nabla_{\bf x} \log \pi({\bf x})\)
- Parameters:
- 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
- hess_x_log_pdf(x, *args, **kwargs)[source]¶
[Abstract] Evaluate \(\nabla^2_{\bf x} \log \pi({\bf x})\)
- Parameters:
- 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
- class TransportMaps.Distributions.FrozenDistributions.WeibullDistribution(c, mu=0.0, sigma=1.0)[source]¶
Bases:
FrozenDistribution_1d
[Abstract] Generic frozen distribution 1d
- rvs(n, *args, **kwargs)[source]¶
[Abstract] Generate \(m\) samples from the distribution.
- Parameters:
m (int) – number of samples to generate
- Returns:
- (
ndarray
[\(m,d\)]) – \(m\) \(d\)-dimensional samples
- (
- Raises:
NotImplementedError – the method needs to be defined in the sub-classes
- pdf(x, *args, **kwargs)[source]¶
Evaluate \(\pi({\bf x})\)
- Parameters:
- Returns:
- (
ndarray
[\(m\)]) – values of \(\pi\) at the
x
points.
- (
- Raises:
NotImplementedError – the method calls :fun:`log_pdf`
- log_pdf(x, *args, **kwargs)[source]¶
[Abstract] Evaluate \(\log \pi({\bf x})\)
- Parameters:
- Returns:
- (
ndarray
[\(m\)]) – values of \(\log\pi\) at the
x
points.
- (
- Raises:
NotImplementedError – the method needs to be defined in the sub-classes
- grad_x_log_pdf(x, *args, **kwargs)[source]¶
[Abstract] Evaluate \(\nabla_{\bf x} \log \pi({\bf x})\)
- Parameters:
- 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
- hess_x_log_pdf(x, *args, **kwargs)[source]¶
[Abstract] Evaluate \(\nabla^2_{\bf x} \log \pi({\bf x})\)
- Parameters:
- 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
- class TransportMaps.Distributions.FrozenDistributions.CauchyDistribution(loc, scale)[source]¶
Bases:
FrozenDistribution_1d
[Abstract] Generic frozen distribution 1d
- pdf(x, params=None)[source]¶
Evaluate \(\pi({\bf x})\)
- Parameters:
- Returns:
- (
ndarray
[\(m\)]) – values of \(\pi\) at the
x
points.
- (
- Raises:
NotImplementedError – the method calls :fun:`log_pdf`
- log_pdf(x, params=None)[source]¶
[Abstract] Evaluate \(\log \pi({\bf x})\)
- Parameters:
- Returns:
- (
ndarray
[\(m\)]) – values of \(\log\pi\) at the
x
points.
- (
- Raises:
NotImplementedError – the method needs to be defined in the sub-classes
- rvs(n)[source]¶
[Abstract] Generate \(m\) samples from the distribution.
- Parameters:
m (int) – number of samples to generate
- Returns:
- (
ndarray
[\(m,d\)]) – \(m\) \(d\)-dimensional samples
- (
- Raises:
NotImplementedError – the method needs to be defined in the sub-classes
- quadrature(qtype, qparams)[source]¶
Generate quadrature points and weights.
Types of quadratures:
- Monte-Carlo (
qtype==0
) qparams
: (int
) – number of samples- Quasi-Monte-Carlo (
qtype==1
) qparams
: (int
) – number of samples- Latin-Hypercube-Sampling (
qtype==2
) qparams
: (int
) – number of samples- Gauss-quadrature (
qtype==3
) qparams
: (list
[\(d\)]) – orders for each dimension- Sparse Grid Gauss-Hermite quadrature (
qtype==4
) qparams
: (list
[\(d\)]) – orders for each dimension
See also
Distribution.quadrature()
- Monte-Carlo (
- class TransportMaps.Distributions.FrozenDistributions.StudentTDistribution(df, mu=0.0, sigma=1.0)[source]¶
Bases:
FrozenDistribution_1d
[Abstract] Generic frozen distribution 1d
- rvs(n, *args, **kwargs)[source]¶
[Abstract] Generate \(m\) samples from the distribution.
- Parameters:
m (int) – number of samples to generate
- Returns:
- (
ndarray
[\(m,d\)]) – \(m\) \(d\)-dimensional samples
- (
- Raises:
NotImplementedError – the method needs to be defined in the sub-classes
- pdf(x, *args, **kwargs)[source]¶
Evaluate \(\pi({\bf x})\)
- Parameters:
- Returns:
- (
ndarray
[\(m\)]) – values of \(\pi\) at the
x
points.
- (
- Raises:
NotImplementedError – the method calls :fun:`log_pdf`
- log_pdf(x, *args, **kwargs)[source]¶
[Abstract] Evaluate \(\log \pi({\bf x})\)
- Parameters:
- Returns:
- (
ndarray
[\(m\)]) – values of \(\log\pi\) at the
x
points.
- (
- Raises:
NotImplementedError – the method needs to be defined in the sub-classes
- grad_x_log_pdf(x, *args, **kwargs)[source]¶
[Abstract] Evaluate \(\nabla_{\bf x} \log \pi({\bf x})\)
- Parameters:
- 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
- hess_x_log_pdf(x, *args, **kwargs)[source]¶
[Abstract] Evaluate \(\nabla^2_{\bf x} \log \pi({\bf x})\)
- Parameters:
- 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
- class TransportMaps.Distributions.FrozenDistributions.BananaDistribution(a, b, mu, sigma2)[source]¶
Bases:
TransportMaps.Distributions.TransportMapDistributions.PushForwardTransportMapDistribution
Class for densities of the transport map type \(T_\sharp \pi\)
- Parameters:
transport_map (Maps.TriangularTransportMap) – transport map \(T\)
base_distribution (Distributions.Distribution) – distribution \(\pi\)
See also
TransportMapDistribution