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. |
gauss_scores: Vector
property
🍋
hermite_coefficients: np.ndarray
property
🍋
Return coefficients of Hermite Polynomials transform function.
Returns:
Type | Description |
---|---|
ndarray
|
Coefficients of Hermite polynomials. |
empirical_inverse_transform(x)
🍋
empirical_transform(x)
🍋
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.