View source: R/FindParameters.R
find_transformation_parameters | R Documentation |
find_transformation_parameters
is used to find optimal parameters for
univariate transformation to normality.
find_transformation_parameters(
x,
method = "yeo_johnson",
robust = TRUE,
invariant = TRUE,
lambda = c(-4, 6),
empirical_gof_normality_p_value = NULL,
...
)
x |
A vector with numeric values. |
method |
One of the following methods for power transformation:
|
robust |
Flag for using a robust version of Box-Cox or Yeo-Johnson transformation, as defined by Raymaekers and Rousseeuw (2021). This version is less sensitive in the presence outliers. |
invariant |
Flag for using a version of Box-Cox or Yeo-Johnson transformation that simultaneously optimises location and scale in addition to the lambda parameter. |
lambda |
Single lambda value, or range of lambda values that should be
considered. Default: c(4.0, 6.0). Can be |
empirical_gof_normality_p_value |
Significance value for the empirical
goodness-of-fit test for central normality. The p-value is computed through
the |
... |
Unused parameters. |
A transformer object that can be used to transform values.
Yeo, I. & Johnson, R. A. A new family of power transformations to improve normality or symmetry. Biometrika 87, 954–959 (2000).
Box, G. E. P. & Cox, D. R. An analysis of transformations. J. R. Stat. Soc. Series B Stat. Methodol. 26, 211–252 (1964).
Raymaekers, J., Rousseeuw, P. J. Transforming variables to central normality. Mach Learn. (2021).
x <- exp(stats::rnorm(1000))
transformer <- find_transformation_parameters(
x = x,
method = "box_cox")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.