# TransportMaps.Maps.Functionals.PointwiseMonotoneLinearSpanTensorizedParametricFunctionalBase¶

## Module Contents¶

### Classes¶

 PointwiseMonotoneLinearSpanTensorizedParametricFunctional Approximation of the type $$f \approx f_{\bf a} = \sum_{{\bf i} \in \mathcal{I}} {\bf a}_{\bf i} \Phi_{\bf i}$$, monotonic in $$x_d$$ MonotonicLinearSpanApproximation Approximation of the type $$f \approx f_{\bf a} = \sum_{{\bf i} \in \mathcal{I}} {\bf a}_{\bf i} \Phi_{\bf i}$$, monotonic in $$x_d$$
class TransportMaps.Maps.Functionals.PointwiseMonotoneLinearSpanTensorizedParametricFunctionalBase.PointwiseMonotoneLinearSpanTensorizedParametricFunctional(basis_list, q=None, p=1.0, w=None, SemilatticeConstructor=LinearSpanSemilattice, semilattice=None, spantype=None, order_list=None, multi_idxs=None, full_basis_list=None)[source]

Approximation of the type $$f \approx f_{\bf a} = \sum_{{\bf i} \in \mathcal{I}} {\bf a}_{\bf i} \Phi_{\bf i}$$, monotonic in $$x_d$$

Parameters:
• basis_list (list) – list of $$d$$ OrthogonalBasis

• spantype (str) – Span type. ‘total’ total order, ‘full’ full order, ‘midx’ multi-indeces specified

• order_list (list of int) – list of orders $$\{N_i\}_{i=0}^d$$

• multi_idxs (list) – list of tuples containing the active multi-indices

precomp_regression(x, precomp=None, *args, **kwargs)[source]

Precompute necessary structures for the speed up of regression()

Parameters:
Returns:

(dict) – dictionary of necessary strucutres

get_identity_coeffs()[source]
regression(f, fparams=None, d=None, qtype=None, qparams=None, x=None, w=None, x0=None, regularization=None, tol=0.0001, maxit=100, batch_size=(None, None), mpi_pool=None, import_set=set())[source]

Compute $${\bf a}^* = \arg\min_{\bf a} \Vert f - f_{\bf a} \Vert_{\pi}$$.

Parameters:
• f (Function or ndarray [$$m$$]) – function $$f$$ or its functions values

• d (Distribution) – distribution $$\pi$$

• fparams (dict) – parameters for function $$f$$

• qtype (int) – quadrature type to be used for the approximation of $$\mathbb{E}_{\pi}$$

• qparams (object) – parameters necessary for the construction of the quadrature

• x (ndarray [$$m,d$$]) – quadrature points used for the approximation of $$\mathbb{E}_{\pi}$$

• w (ndarray [$$m$$]) – quadrature weights used for the approximation of $$\mathbb{E}_{\pi}$$

• x0 (ndarray [$$N$$]) – coefficients to be used as initial values for the optimization

• regularization (dict) – defines the regularization to be used. If None, no regularization is applied. If key type=='L2' then applies Tikonhov regularization with coefficient in key alpha.

• tol (float) – tolerance to be used to solve the regression problem.

• maxit (int) – maximum number of iterations

• batch_size (list  of int) – the list contains the size of the batch to be used for each iteration. A size 1 correspond to a completely non-vectorized evaluation. A size None correspond to a completely vectorized one.

• mpi_pool (mpi_map.MPI_Pool) – pool of processes to be used

• import_set (set) – list of couples (module_name,as_field) to be imported as import module_name as as_field (for MPI purposes)

Returns:

(tuple [$$N$$], list)) – containing the $$N$$ coefficients and log information from the optimizer.

TransportMaps.TriangularTransportMap.regression()

Note

the resulting coefficients $${\bf a}$$ are automatically set at the end of the optimization. Use coeffs() in order to retrieve them.

Note

The parameters (qtype,qparams) and (x,w) are mutually exclusive, but one pair of them is necessary.

regression_constraints(a, params)[source]
Approximation of the type $$f \approx f_{\bf a} = \sum_{{\bf i} \in \mathcal{I}} {\bf a}_{\bf i} \Phi_{\bf i}$$, monotonic in $$x_d$$
• basis_list (list) – list of $$d$$ OrthogonalBasis
• order_list (list of int) – list of orders $$\{N_i\}_{i=0}^d$$