TransportMaps.Maps.TriangularComponentwiseMapBase

Module Contents

Classes

TriangularComponentwiseMap

Triangular map \(T({\bf x}):=[T_1,T_2,\ldots,T_{d_x}]^\top\), where \(T_i(x_{1:i}):\mathbb{R}^i\rightarrow\mathbb{R}\).

class TransportMaps.Maps.TriangularComponentwiseMapBase.TriangularComponentwiseMap(**kwargs)[source]

Bases: TransportMaps.Maps.ComponentwiseMapBase.ComponentwiseMap

Triangular map \(T({\bf x}):=[T_1,T_2,\ldots,T_{d_x}]^\top\), where \(T_i(x_{1:i}):\mathbb{R}^i\rightarrow\mathbb{R}\).

Parameters:
  • active_vars (list [\(d\)] of list) – for each dimension lists the active variables.

  • approx_list (list [\(d\)] of FunctionalApproximations.MonotonicFunctionApproximation) – list of monotonic functional approximations for each dimension

precomp_partial_xd(x, precomp=None, precomp_type='uni')[source]

Precompute necessary structures for the evaluation of \(\partial_{x_k}T_k({\bf x})\) for \(k=1,\ldots,d\)

Enriches the dictionaries in the precomp list if necessary.

Parameters:
  • x (ndarray [\(m,d\)]) – evaluation points

  • precomp (dict) – list of dictionaries of precomputed values

  • precomp_type (str) – whether to precompute univariate Vandermonde matrices ‘uni’ or multivariate Vandermonde matrices ‘multi’

Returns:

(dict of list [\(d\)]

dict) – necessary structures

partial_xd(x, precomp=None, idxs_slice=slice(None), cache=None)[source]

Compute: \([\partial_{{\bf x}_1}T_1({\bf x}_1),\ldots,\partial_{{\bf x}_d}T_d({\bf x}_{1:d})]\)

Parameters:
  • x (ndarray [\(m,d\)]) – evaluation points

  • precomp (dict) – dictionary of precomputed values

  • 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 match x.shape[0].

  • cache (dict) – cache

Returns:

(ndarray [\(m,d\)]) – \([\partial_{{\bf x}_1}T_1({\bf x}_1),\ldots,\partial_{{\bf x}_d}T_d({\bf x}_{1:d})]\) at every evaluation point

Raises:

ValueError – if \(d\) does not match the dimension of the transport map.

precomp_grad_x_partial_xd(x, precomp=None, precomp_type='uni')[source]

Precompute necessary structures for the evaluation of \(\nabla_{\bf x}\partial_{x_k}T_k({\bf x})\) for \(k=1,\ldots,d\)

Enriches the dictionaries in the precomp list if necessary.

Parameters:
  • x (ndarray [\(m,d\)]) – evaluation points

  • precomp (dict) – list of dictionaries of precomputed values

  • precomp_type (str) – whether to precompute univariate Vandermonde matrices ‘uni’ or multivariate Vandermonde matrices ‘multi’

Returns:

(dict of list [\(d\)]

dict) – necessary structures

precomp_hess_x_partial_xd(x, precomp=None, precomp_type='uni')[source]

Precompute necessary structures for the evaluation of \(\nabla^2_{\bf x}\partial_{x_k}T_k({\bf x})\) for \(k=1,\ldots,d\)

Enriches the dictionaries in the precomp list if necessary.

Parameters:
  • x (ndarray [\(m,d\)]) – evaluation points

  • precomp (dict) – list of dictionaries of precomputed values

  • precomp_type (str) – whether to precompute univariate Vandermonde matrices ‘uni’ or multivariate Vandermonde matrices ‘multi’

Returns:

(dict of list [\(d\)]

dict) – necessary structures