geolime.geostats.math.anamorphosis

Functions:

evaluate_hermite_expansion(x[, coeff])

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

gauss_score(z[, weights, sort])

Function to obtain the (standard) Gaussian scores of a sample.

gaussian_anamorphosis(z[, yzmin, yzmax, …])

Function to obtain a Gaussian anamorphose model for a sample.

hermite_coefficients_anamorphosis(n, z[, …])

Function to obtain the Hermite coefficients of a Gaussian anamorphose model function.

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.

inverse_anamorphosis_from_obs(z[, yzmin, …])

Function to obtain the (pseudo-)inverse of a Gaussian anamorphose model for a sample date.

inverse_anamorphosis_theoretical(z, anam[, …])

Compute theoretical inverse anamorphosis

geolime.geostats.math.anamorphosis.gaussian_anamorphosis(z: numpy.ndarray, yzmin: numpy.ndarray = None, yzmax: numpy.ndarray = None, weights: numpy.ndarray = None, gauss_scores: numpy.ndarray = None)

Function to obtain a Gaussian anamorphose model for a sample. The anamorphose used is a continuous piece-wise linear function constructed from the Gaussian scores of the sample data according to weights, together with maximum and minimum optional conditions.

Parameters
  • z (np.ndarray) – numpy array containing the data

  • yzmin (np.ndarray) – numpy array of two elements indicating the minimum values expected for the Gaussian scores and the data values, respectively. By default None. If None, the minimum of the Gaussian scores and of the data values are used.

  • yzmax (np.ndarray) – numpy array of two elements indicating the maximum values expected for the Gaussian scores and the data values, respectively. By default None. If None, the maximum of the Gaussian scores and of the data values are used.

  • weights (np.ndarray) – numpy array containing the probability weights associated to each interval defined by the order statisticals of the data in order to determine the Gaussian scores. By default None, which implies uniform probability weights (see gauss_score function).

  • gauss_scores (np.ndarray) – Option to use the Gaussian scores of the sample as an input directly. By default None. If None, the Gaussian scores will be obtained by this function. If the Gaussian scores are given as an input, they are supposed to be sorted by score. This condition is not verified by this function.

Returns

A numpy array evaluated function, which is piece-wise linear and continuous.

Return type

np.ndarray

geolime.geostats.math.anamorphosis.hermite_coefficients_anamorphosis(n: int, z: numpy.ndarray, yzmin: numpy.ndarray = None, yzmax: numpy.ndarray = None, weights: numpy.ndarray = None, gauss_scores: numpy.ndarray = None, error: bool = False)

Function to obtain the Hermite coefficients of a Gaussian anamorphose model function. The anamorphose used is a continuous piece-wise linear function constructed from the Gaussian scores of the sample data according to weights, together with maximum and minimum optional conditions.

Parameters
  • n (int) – integer determining the order of the Hermite approximation

  • z (np.ndarray) – numpy array containing the data

  • yzmin (np.ndarray) – numpy array of two elements indicating the minimum values expected for the Gaussian scores and the data values, respectively. By default None. If None, the minimum of the Gaussian scores and of the data values are used.

  • yzmax (np.ndarray) – numpy array of two elements indicating the maximum values expected for the Gaussian scores and the data values, respectively. By default None. If None, the maximum of the Gaussian scores and of the data values are used.

  • weights (np.ndarray) – numpy array containing the probability weights associated to each interval defined by the order statisticals of the data in order to determine the Gaussian scores. By default None, which implies uniform probability weights (see gauss_score function).

  • gauss_scores (np.ndarray) – Option to use the Gaussian scores of the sample as an input directly. By default None. If None, the Gaussian scores will be obtained by this function.If the Gaussian scores are given as an input, they are supposed to be sorted by score. This condition is not verified by this function.

  • 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

a numpy array conatining the first coefficients of the Hermite expansion of the anamorphose. if Error=True, a list, 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.anamorphosis.inverse_anamorphosis_from_obs(z: numpy.ndarray, yzmin: numpy.ndarray = None, yzmax: numpy.ndarray = None, weights: numpy.ndarray = None, gauss_scores: numpy.ndarray = None)

Function to obtain the (pseudo-)inverse of a Gaussian anamorphose model for a sample date. The anamorphose used is a continuous piece-wise linear function constructed from the Gaussian scores of the sample data according to weights, together with maximum and minimum optional conditions. If there are no two equal data-values, the anamorphose is bijective over the interval determined by the minimum and maximum scores. This function obtains hence the inverse in this interval. Outside this interval every value is associated to the theoretical minimal or maximal data value.

Parameters
  • z (np.ndarray) – numpy array containing the data

  • yzmin (np.ndarray) – numpy array of two elements indicating the minimum values expected for the Gaussian scores and the data values, respectively. By default None. If None, the minimum of the Gaussian scores and of the data values are used.

  • yzmax (np.ndarray) – numpy array of two elements indicating the maximum values expected for the Gaussian scores and the data values, respectively. By default None. If None, the maximum of the Gaussian scores and of the data values are used.

  • weights (np.ndarray) – numpy array containing the probability weights associated to each interval defined by the order statisticals of the data in order to determine the Gaussian scores. By default None, which implies uniform probability weights (see gauss_score function).

  • gauss_scores (np.ndarray) – Option to use the Gaussian scores of the sample as an input directly. By default None. If None, the Gaussian scores will be obtained by this function. If the Gaussian scores are given as an input, they are supposed to be sorted by score. This condition is not verified by this function.

Returns

a numpy array evaluated function, which is piece-wise linear and continuous, corresponding to the inverse of the anamorphose function in the bijectivity interval.

Return type

np.ndarray

geolime.geostats.math.anamorphosis.inverse_anamorphosis_theoretical(z: numpy.ndarray, anam: numpy.ndarray, ymin: float = - 4.5, ymax: float = 4.5, nlag: int = 200)

Compute theoretical inverse anamorphosis

Parameters
  • z (np.ndarray) – Estimation array

  • anam (np.ndarray) – anamorphosis array

  • ymin (float) – Minimum boundary for sampling

  • ymax (float) – Maximum boundary for sampling

  • nlag (int) – Sampling lags

Returns

Description of returned object.

Return type

type