Skip to content

Anamorphosis🍋

Anamorphosis 🍋

Anamorphosis class.

Allows to transform skew data into standardize data. Transformation is bijective in the interval defined by the data.

Parameters:

Name Type Description Default
data ndarray

Numpy array containing the data.

required
gauss_scores Optional[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.

None

Attributes:

Name Type Description
data Vector

Data in real space.

gauss_scores Vector

Data in gaussian space.

hermite_coefficients ndarray

Coefficients of hermite polynomials used to transform data from real to gaussian.

data: Vector property 🍋

Return real data.

Returns:

Type Description
Vector

Array of data.

gauss_scores: Vector property 🍋

Return gaussian score of data.

Returns:

Type Description
Vector

Gaussian scores.

hermite_coefficients: np.ndarray property 🍋

Return coefficients of Hermite Polynomials transform function.

Returns:

Type Description
ndarray

Coefficients of Hermite polynomials.

empirical_inverse_transform(x) 🍋

Compute the gaussian inverse anamorphosis of the input array using a linear interpolation of the gaussian scores.

Parameters:

Name Type Description Default
x ndarray

Input array containing values in reel space.

required

Returns:

Type Description
ndarray

Transformed array = gaussian values.

empirical_transform(x) 🍋

Compute the gaussian anamorphosis of the input array using a linear interpolation of the gaussian scores.

Parameters:

Name Type Description Default
x ndarray

Input array containing values in gaussian space.

required

Returns:

Type Description
ndarray

Transformed array = real values.

theoretical_inverse_transform(x, r=1.0) 🍋

Compute the gaussian inverse anamorphosis of the input array using an interpolation with Hermite polynomials of the gaussian scores. Obtained values are approximates from results of transform gausian values.

Parameters:

Name Type Description Default
x ndarray

Input array containing values in reel space.

required
r float

Change of support coefficient.

1.0

Returns:

Type Description
ndarray

Transformed array = gaussian values.

theoretical_transform(x, r=1.0) 🍋

Compute the gaussian anamorphosis of the input array using an interpolation with Hermite polynomials of the gaussian scores.

Parameters:

Name Type Description Default
x ndarray

Input array containing values in gaussian space.

required
r float

Change of support coefficient.

1.0

Returns:

Type Description
ndarray

Transformed array = real values.

gauss_score(z) 🍋

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

Parameters:

Name Type Description Default
z Vector

numpy array containing the data.

required

Returns:

Type Description
ndarray

A numpy array that contains the Gaussian scores.

??? warning "NaN values" NaN values are filtered out before performing the gaussian score computation.


Last update: 2022-01-06