Approximation

class approx(X, y, U, N, basis='cos')

A class to hold the scattered data function approximation.

This class represents an approximation object constructed from scattered data nodes, function values, an ANOVA decomposition class, and a choice of basis functions. It supports multiple bases and regularization parameters.

Attributes:

basis

Type: str

Basis of the function space. Supported values are:

  • “per”: exponential functions

  • “cos”: cosine functions

  • “cheb”: Chebyshev basis

  • “std”: transformed exponential functions

  • “chui1”: Haar wavelets

  • “chui2”: Chui-Wang wavelets of order 2

  • “chui3”: Chui-Wang wavelets of order 3

  • “chui4”: Chui-Wang wavelets of order 4

X

Type: Numpy array wit dtype float

The scattered data nodes with M rows and d columns.

y

Type: Numpy array wit dtype float or complex

A vector of M function values. Complex-valued for basis = “per”, real-valued otherwise.

U

Type: List[Tuple[int]]

A vector containing subsets of coordinate indices representing the ANOVA decomposition.

N

Type: List[int]

Bandwidths for each ANOVA term.

trafo

Type: GroupedTransform

Holds the grouped transformation.

fc

Type: Dict[float, GroupedCoefficients]

holds the GroupedCoefficients after approximation for every different regularization parameters

Constructor:

approx(X, y, U, N, basis='cos')

Additional Constructor:

approx(X, y, ds, N, basis='cos')

Functions:

approximate(self, lam, max_iter=50, weights=None, verbose=False, solver=None, tol=1e-8)

If lam is a np.ndarray of dtype float, this function computes the approximation for the regularization parameters contained in lam.

If lam is a float, this function computes the approximation for the regularization parameter lam.

evaluate(self, lam=None, X=None)

This function evaluates the approximation with optional node matrix X and regularization lam.

  • If both X and lam are given: evaluate at X for specific lam.

  • If only X is given: evaluate at X for all lam.

  • If only lam is given: evaluate at self.X for specific lam.

  • If neither are given: evaluate at self.X for all lam.

evaluateANOVAterms(self, X, lam=None)

This function evaluates the single ANOVA terms of the approximation on the nodes of matrix X and regularization lam.

  • If lam is given: evaluate at X for specific lam.

  • If lam is not given: evaluate at X for all lam.

evaluateSHAPterms(self, X, lam=None)

This function evaluates for each dimension the Shapley contribution to the overall approximation on the nodes of matrix X and regularization lam.

  • If lam is given: evaluate at X for specific lam.

  • If lam is not given: evaluate at X for all lam.