transfo_transformback {cellWise} | R Documentation |
Backtransform variables based on the output of transfo
.
Description
Based on the output of transfo
, backtransform the variables to their original shape through the inverse Yeo-Johnson and/or Box-Cox transformations with the previusly estimated parameters and standardization.
Usage
transfo_transformback(Ynew, transfo.out)
Arguments
Ynew |
A data matrix with d columns, which contain the variables to be backtransformed. The number of columns must be the same as the output |
transfo.out |
The output of a call to |
Value
Returns a matrix with backtransformed variables.
Author(s)
J. Raymaekers and P.J. Rousseeuw
References
J. Raymaekers and P.J. Rousseeuw (2021). Transforming variables to central normality. Machine Learning. doi:10.1007/s10994-021-05960-5(link to open access pdf)
See Also
Examples
set.seed(123); x <- matrix(rnorm(2000), ncol = 2)
y <- sqrt(abs(0.3 * x[, 1] + 0.5 * x[, 2] + 4))
ty.out <- transfo(y, type = "BC")
ty.out$lambdahats
ty <- ty.out$Y
lm.out <- lm(ty ~ x)
yhat <- transfo_transformback(lm.out$fitted.values, ty.out)
plot(y, yhat); abline(0, 1)
[Package cellWise version 2.5.3 Index]