geolime.geostats.math.hermite

Classes:

Enum(value)

Generic enumeration.

Functions:

evaluate_hermite_expansion(x[, coeff])

Evaluate at x a function determined by its coefficients in the Hermite expansion.

evaluate_hermite_expansion_for_metal(val, …)

Evaluate germite expansion for metal

evaluate_hermite_expansion_for_metal_memsafe_variable(…)

evaluate_hermite_expansion_memsafe(x[, coeff])

Evaluate at x a function determined by its coefficients in the Hermite expansion.

evaluate_hermite_expansion_memsafe_variable(x, …)

Evaluate at x a function determined by its coefficients in the Hermite expansion.

hermite_coefficients_piecewise_linear(n, x, y)

Computes the Hermite coefficients of a piece-wise linear function continuous in an interval, with a desired extension outside the interval.

hermite_polynomials(x, n)

Function to compute the Hermite polynomials up to order n.

geolime.geostats.math.hermite.evaluate_hermite_expansion(x: numpy.ndarray, coeff: numpy.ndarray = array([0]))

Evaluate at x a function determined by its coefficients in the Hermite expansion.

Parameters
  • x (np.ndarray) – numpy array containing the points where the expansion is evaluated.

  • coeff (np.ndarray) – numpy array containing the coefficients in the Hermite expansion (the n-th element is the coefficient associated to the n-th Hermite polynomial)

Returns

numpy array containing the approximation of the function in a truncated Hermite expansion at x (the function is vectorized).

Return type

np.ndarray

geolime.geostats.math.hermite.evaluate_hermite_expansion_for_metal(val: numpy.ndarray, coeffs: numpy.ndarray, rho: numpy.ndarray, sigma: float, u: numpy.ndarray)

Evaluate germite expansion for metal

Parameters
  • val (np.ndarray) – Kriging results

  • coeffs (np.ndarray) – Block anamorphosis array

  • rho (np.ndarray) – Mean

  • sigma (float) – Variance

  • u (np.ndarray) – Inverse anamorphosis array

Returns

Hermite expansion

Return type

np.ndarray

geolime.geostats.math.hermite.evaluate_hermite_expansion_for_metal_memsafe_variable(val, coeffs, rho, sigma, u)
geolime.geostats.math.hermite.evaluate_hermite_expansion_memsafe(x: numpy.ndarray, coeff: numpy.ndarray = array([0]))

Evaluate at x a function determined by its coefficients in the Hermite expansion.

Parameters
  • x (np.ndarray) – numpy array containing the points where the expansion is evaluated.

  • coeff (np.ndarray) – numpy array containing the coefficients in the Hermite expansion (the n-th element is the coefficient associated to the n-th Hermite polynomial)

Returns

numpy array containing the approximation of the function in a truncated Hermite expansion at x (the function is vectorized).

Return type

np.ndarray

geolime.geostats.math.hermite.evaluate_hermite_expansion_memsafe_variable(x: numpy.ndarray, coeff: numpy.ndarray)

Evaluate at x a function determined by its coefficients in the Hermite expansion.

Parameters
  • x (np.ndarray) – numpy array containing the points where the expansion is evaluated.

  • coeff (np.ndarray) – numpy array containing the coefficients in the Hermite expansion (the n-th element is the coefficient associated to the n-th Hermite polynomial)

Returns

numpy array containing the approximation of the function in a truncated Hermite expansion at x (the function is vectorized).

Return type

np.ndarray

geolime.geostats.math.hermite.hermite_coefficients_piecewise_linear(n: int, x: numpy.ndarray, y: numpy.ndarray, extension: enum.Enum = 'constant', sort: bool = True, error: bool = False)

Computes the Hermite coefficients of a piece-wise linear function continuous in an interval, with a desired extension outside the interval.

Parameters
  • n (int) – non-negative integer indicating the order up to which the Hermite coefficients are obtained.

  • x (np.ndarray) – numpy array of points in the real line indicating the breakpoints for the pice-wise linear function. Hence the function is continuous within the interval [x[0] , x[x.size-1]]. The elements of x must all be different with respect to each other.

  • y (np.ndarray) – numpy array indicating the images of the breakpoints x of the piece-wise linear function. It must have the same number of elements as x.

  • extension (string) – string indicating the definition of the function outside the pice-wise linear intervale. Two options available: “constant” and “null”. “constant”: (default option) the function is continuously extended having constant values over the two sides of the interval. “null”: the function is null outside the interval. Thus may imply that the resulting function is not continuous over the whole real line.

  • sort (bool) – boolean (by default True). If True, it is supposed that the values in x are sorted. If false, the arrays x and y are sorted according to x’s sorting order.

  • error (bool) – boolean (by default False). If True, the approximation error (L^2 norm with Gaussian weight) will be retourned as a second element of the output list.

Returns

numpy array containing the first coefficients in the Hermite expansion of the function. If Error=True, a (n,2) array, the first element containing the coefficients (previous output) and the second containing the error of the Hermite approximation.

Return type

np.ndarray

geolime.geostats.math.hermite.hermite_polynomials(x: numpy.ndarray, n: int)

Function to compute the Hermite polynomials up to order n.

Parameters
  • x (np.ndarray) – numpy array containing the points where the polynomials are evaluated (this function is vectorized).

  • n (int) – non-negative integer indicating the maximal order of the desired polynomials.

Returns

Numpy matrix of shape (n+1 , x.size ) whose k-th row contains the Hermite polynomial of order k evaluated at x.

Return type

np.ndarray