signed_log: Calculates the signed log of a value

Description Usage Arguments Examples

View source: R/signed_log.R

Description

The signed logarithm allows a pseudo-logarithmic re-scaling to be performed on data that is both positive and negativeis. It defined as:

\textrm{signed_log}_b(x) = \textrm{sign}(x)\log_b(|x| + 1)

Usage

1
2
3
signed_log(x, base = exp(1))

unsigned_log(x, base = exp(1))

Arguments

x

a numeric vector.

base

a positive number

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
x <- seq(-10, 10, 0.01)
y <- signed_log(x)

plot(x, y, type = "l")

x0 <- unsigned_log(y)

plot(y, x0, type = "l")

plot(x, x0, type = "l")

MyKo101/mutils documentation built on July 28, 2020, 8:52 p.m.