
bcPower(U, lambda, jacobian.adjusted=FALSE, gamma=NULL)
yjPower(U, lambda, jacobian.adjusted = FALSE)
basicPower(U,lambda, gamma=NULL)
U
is a matrix or data frame, a vector of length
ncol(U)
of transformation parametersTRUE
, the transformation is normalized to have
Jacobian equal to one. The default is FALSE
.U + gamma
must be strictly positive to use this family.
If family="yeo.johnson"
then the Yeo-Johnson transformations are used.
This is the Box-Cox transformation of $U+1$ for nonnegative values,
and of $|U|+1$ with parameter $2-\lambda$ for $U$ negative. An alternative family to the Yeo-Johnson family is the skewPower
family that requires estimating both a power and an second parameter.
The basic power transformation returns $U^{\lambda}$ if $\lambda$
is not zero, and $\log(\lambda)$ otherwise.
If jacobian.adjusted
is TRUE
, then the scaled transformations are divided by the
Jacobian, which is a function of the geometric mean of $U$ for skewPower and yjpower and of $U + gamma$ for bcPower. With this adjustment, the Jacobian of the transformation is always equal to 1.
Missing values are permitted, and return NA
where ever U
is equal to NA
.powerTransform
, skewPower
U <- c(NA, (-3:3))
bcPower(U, 0) # produces an error as U has negative values
bcPower(U, 0, gamma=4)
bcPower(U, .5, jacobian.adjusted=TRUE, gamma=4)
basicPower(U, lambda = 0, gamma=4)
yjPower(U, 0)
V <- matrix(1:10, ncol=2)
bcPower(V, c(0, 2))
basicPower(V, c(0,1))
Run the code above in your browser using DataLab