rangepowerTransform {mclustAddons} | R Documentation |
Range–power transformation
Description
Functions to compute univariate range–power transformation and its back-transform.
Usage
rangepowerTransform(x, lbound = -Inf, ubound = +Inf, lambda = 1)
rangepowerBackTransform(y, lbound = -Inf, ubound = +Inf, lambda = 1)
Arguments
x |
A numeric vector of data values. |
y |
A numeric vector of transformed data values. |
lbound |
A numerical value of variable lower bound. |
ubound |
A numerical value of variable upper bound. |
lambda |
A numerical value for the power transformation. |
Details
The range-power transformation can be applied to variables with bounded support.
Lower bound case
Suppose is a univariate random variable with lower bounded support
, where
.
Consider a preliminary range transformation defined as
, which maps
.
The range-power transformation is a continuous monotonic transformation defined as
with back-transformation function
Lower and upper bound case
Suppose is a univariate random variable with bounded support
, where
. Consider a preliminary range transformation defined as
, which maps
.
In this case, the range-power transformation is a continuous monotonic transformation defined as
with back-transformation function
Value
Returns a vector of transformed or back-transformed values.
Author(s)
Luca Scrucca
References
Scrucca L. (2019) A transformation-based approach to Gaussian mixture density estimation for bounded data. Biometrical Journal, 61:4, 873–888. https://doi.org/10.1002/bimj.201800174
See Also
Examples
# Lower bound case
x = rchisq(1000, 5)
y = rangepowerTransform(x, lbound = 0, lambda = 1/3)
par(mfrow=c(2,2))
hist(x, main = NULL, breaks = 21); rug(x)
hist(y, xlab = "y = t(x)", main = NULL, breaks = 21); rug(y)
xx = rangepowerBackTransform(y, lbound = 0, lambda = 1/3)
hist(xx, xlab = "t^-1(y) = x", main = NULL, breaks = 21); rug(xx)
plot(x, xx, ylab = "t^-1(y)"); abline(0,1)
# Lower and upper bound case
x = rbeta(1000, 2, 1)
y = rangepowerTransform(x, lbound = 0, ubound = 1, lambda = 0)
par(mfrow=c(2,2))
hist(x, main = NULL, breaks = 21); rug(x)
hist(y, xlab = "y = t(x)", main = NULL, breaks = 21); rug(y)
xx = rangepowerBackTransform(y, lbound = 0, ubound = 1, lambda = 0)
hist(xx, xlab = "t^-1(y) = x", main = NULL, breaks = 21); rug(xx)
plot(x, xx, ylab = "t^-1(y)"); abline(0,1)