mt: Modulus transformation (and its inverse).

Description Usage Arguments Details References Examples

View source: R/RcppExports.R

Description

A generalisation of the box-cox transformation that works for values with both positive and negative values.

Usage

1
2
3
mt(x, lambda = 0)

inv_mt(x, lambda = 0)

Arguments

x

values to transform

lambda

degree of transformation

Details

This is useful for compressing the tails of long-tailed distributions, often encountered with very large datasets.

References

J. John and N. Draper. "An alternative family of transformations." Applied Statistics, pages 190-197, 1980. http://www.jstor.org/stable/2986305

Examples

1
2
3
4
5
6
7
8
x <- seq(-10, 10, length = 100)
plot(x, mt(x, 0), type = "l")
plot(x, mt(x, 0.25), type = "l")
plot(x, mt(x, 0.5), type = "l")
plot(x, mt(x, 1), type = "l")
plot(x, mt(x, 2), type = "l")
plot(x, mt(x, -1), type = "l")
plot(x, mt(x, -2), type = "l")

hadley/ggstat documentation built on May 17, 2019, 10:40 a.m.