Learn R Programming

cellWise (version 2.5.3)

transfo_transformback: 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)

Value

Returns a matrix with backtransformed variables.

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 Y of the run of transfo on the original data. The number of rows may be different.

transfo.out

The output of a call to transfo.

Author

J. Raymaekers and P.J. Rousseeuw

References

J. Raymaekers and P.J. Rousseeuw (2021). Transforming variables to central normality. Machine Learning. tools:::Rd_expr_doi("10.1007/s10994-021-05960-5")(link to open access pdf)

See Also

transfo

Examples

Run this code
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)

Run the code above in your browser using DataLab