TransportMaps.Distributions.ParametricDistributionBase

Module Contents

Classes

ParametricDistribution

Parametric distribution \(\pi_{\bf a}\).

class TransportMaps.Distributions.ParametricDistributionBase.ParametricDistribution(dim)[source]

Bases: TransportMaps.Distributions.DistributionBase.Distribution

Parametric distribution \(\pi_{\bf a}\).

abstract property coeffs[source]

[Abstract] Get the coefficients \({\bf a}\) of the distribution

Returns:

(ndarray [\(N\)]) – coefficients

Raises:

NotImplementedError – the method needs to be defined in the sub-classes

abstract property n_coeffs[source]

[Abstract] Get the number \(N\) of coefficients

Returns:

(int) – number of coefficients.

Raises:

NotImplementedError – the method needs to be defined in the sub-classes

get_coeffs()[source]
_set_coeffs(coeffs)[source]
set_coeffs(coeffs)[source]
get_n_coeffs()[source]
abstract grad_a_log_pdf(x, *args, **kwargs)[source]

[Abstract] Evaluate \(\nabla_{\bf a} \log \pi({\bf x})\)

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

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

Returns:

(ndarray [\(m,N\)]) – \(\nabla_{\bf a} \log \pi({\bf x})\)

Raises:

NotImplementedError – the method needs to be defined in the sub-classes

tuple_grad_a_log_pdf(x, params=None, idxs_slice=slice(None, None, None), cache=None)[source]

[Abstract] Evaluate \(\left(\log \pi({\bf x}), \nabla_{\bf a} \log \pi({\bf x})\right)\)

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

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

  • cache (dict) – cache

Returns:

(tuple) – \(\left(\log \pi({\bf x}), \nabla_{\bf a} \log \pi({\bf x})\right)\)

Raises:

NotImplementedError – the method needs to be defined in the sub-classes

abstract hess_a_log_pdf(x, *args, **kwargs)[source]

[Abstract] Evaluate \(\nabla^2_{\bf a} \log \pi({\bf x})\)

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

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

Returns:

(ndarray [\(m,N\)]) – \(\nabla^2_{\bf a} \log \pi({\bf x})\)

Raises:

NotImplementedError – the method needs to be defined in the sub-classes

abstract action_hess_a_log_pdf(x, da, *args, **kwargs)[source]

[Abstract] Evaluate \(\langle \nabla^2_{\bf a} \log \pi({\bf x}), \delta{\bf a}\rangle\)

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

  • da (ndarray [\(N\)]) – direction on which to evaluate the Hessian

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

Returns:

(ndarray [\(m,N\)]) – \(\nabla^2_{\bf a} \log \pi({\bf x})\)

Raises:

NotImplementedError – the method needs to be defined in the sub-classes