gstools.normalizer.Manly

class gstools.normalizer.Manly(data=None, **parameter)[source]

Bases: Normalizer

Manly (1971) transformed fields.

Parameters:
  • data (array_like, optional) – Input data to fit the transformation in order to gain normality. The default is None.

  • lmbda (float, optional) – Shape parameter. Default: 1

Notes

This transformation is given by [Manly1976]:

\[\begin{split}y=\begin{cases} \frac{\exp(\lambda x) - 1}{\lambda} & \lambda\neq 0 \\ x & \lambda = 0 \end{cases}\end{split}\]

References

[Manly1976]

B. F. J. Manly, “Exponential data transformations.”, Journal of the Royal Statistical Society D, 25.1, 37-42 (1976).

Attributes:
denormalize_range

tuple: Valid range for output data depending on lmbda.

name

str: The name of the normalizer class.

Methods

denormalize(data)

Transform to input distribution.

derivative(data)

Factor for normal PDF to gain target PDF.

fit(data[, skip])

Fitting the transformation to data by maximizing Log-Likelihood.

kernel_loglikelihood(data)

Kernel Log-Likelihood for given data with current parameters.

likelihood(data)

Likelihood for given data with current parameters.

loglikelihood(data)

Log-Likelihood for given data with current parameters.

normalize(data)

Transform to normal distribution.

denormalize(data)

Transform to input distribution.

Parameters:

data (array_like) – Input data (normal distributed).

Returns:

Denormalized data.

Return type:

numpy.ndarray

derivative(data)

Factor for normal PDF to gain target PDF.

Parameters:

data (array_like) – Input data (not normal distributed).

Returns:

Derivative of the normalization transformation function.

Return type:

numpy.ndarray

fit(data, skip=None, **kwargs)

Fitting the transformation to data by maximizing Log-Likelihood.

Parameters:
  • data (array_like) – Input data to fit the transformation to in order to gain normality.

  • skip (list of str or None, optional) – Names of parameters to be skipped in fitting. The default is None.

  • **kwargs – Keyword arguments passed to scipy.optimize.minimize_scalar when only one parameter present or scipy.optimize.minimize.

Returns:

Optimal parameters given by names.

Return type:

dict

kernel_loglikelihood(data)

Kernel Log-Likelihood for given data with current parameters.

Parameters:

data (array_like) – Input data to fit the transformation to in order to gain normality.

Returns:

Kernel Log-Likelihood of the given data.

Return type:

float

Notes

This loglikelihood function is neglecting additive constants, that are not needed for optimization.

likelihood(data)

Likelihood for given data with current parameters.

Parameters:

data (array_like) – Input data to fit the transformation to in order to gain normality.

Returns:

Likelihood of the given data.

Return type:

float

loglikelihood(data)

Log-Likelihood for given data with current parameters.

Parameters:

data (array_like) – Input data to fit the transformation to in order to gain normality.

Returns:

Log-Likelihood of the given data.

Return type:

float

normalize(data)

Transform to normal distribution.

Parameters:

data (array_like) – Input data (not normal distributed).

Returns:

Normalized data.

Return type:

numpy.ndarray

default_parameter = {'lmbda': 1}

Default parameter of the Manly-Normalizer.

Type:

dict

property denormalize_range

Valid range for output data depending on lmbda.

(-1/lmbda, inf) or (-inf, -1/lmbda)

Type:

tuple

property name

The name of the normalizer class.

Type:

str

normalize_range = (-inf, inf)

Valid range for input data.

Type:

tuple