gstools.normalizer.YeoJohnson
- class gstools.normalizer.YeoJohnson(data=None, **parameter)[source]
Bases:
gstools.normalizer.base.Normalizer
Yeo-Johnson (2000) 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
References
- Yeo2000
I.K. Yeo and R.A. Johnson, “A new family of power transformations to improve normality or symmetry.” Biometrika, 87(4), pp.954-959, (2000).
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
- 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
- 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
ofstr
orNone
, optional) – Names of parameters to be skiped in fitting. The default is None.**kwargs – Keyword arguments passed to
scipy.optimize.minimize_scalar
when only one parameter present orscipy.optimize.minimize
.
- Returns
Optimal paramters given by names.
- Return type
- 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
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
- 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
- normalize(data)
Transform to normal distribution.
- Parameters
data (array_like) – Input data (not normal distributed).
- Returns
Normalized data.
- Return type