Last data update: 2014.03.03

R: Log Linear Hybrid, Generalized Log
LogLinR Documentation

Log Linear Hybrid, Generalized Log

Description

Computes the log linear hybrid transformation, resp. generalized log, with the goal to stabilize the variance.

Usage

LogLin(x, a)
LogGen(x, a)

Arguments

x

a numeric vector, matrix or data frame.

a

cutoff for the linear part of the transformation

Details

The log linear hybrid transformation function is linear for x <= a and logarithmic for x > a. It is continuously differentiable. The generalized log and log-linear hybrid transformations were introduced in then context of gen-expression microarray data by Rocke and Durbin (2003).

The function LogLin is currently defined as:

function (x, a) {
  x[x<=a] <- x[x<=a] / a + log(a) - 1 
  x[x>a] <- log(x[x>a])
  return(x)
} 

and LogGen as:

function (x, a) {
 return(log((x + sqrt(x^2 + a^2)) / 2))
}

Value

a numeric vector of the same dimensions as x containing the transformed results.

Author(s)

Andri Signorell <andri@signorell.net>

References

Rocke DM, Durbin B (2003): Approximate variance-stabilizing transformations for gene-expression microarray data, Bioinformatics. 22;19(8):966-72.

See Also

LogSt, log

Examples

x <- seq(-10, 50, 0.1 )

plot(LogLin(x, a=5) ~ x, type="l")
grid()
lines(LogLin(x, a=2) ~ x, col="brown")
lines(LogLin(x, a=0.5) ~ x, col="steelblue")

lines(LogGen(x, a=1) ~ x, col="orange")

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(DescTools)
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/DescTools/LogLin.Rd_%03d_medium.png", width=480, height=480)
> ### Name: LogLin
> ### Title: Log Linear Hybrid, Generalized Log
> ### Aliases: LogLin LogGen
> ### Keywords: math
> 
> ### ** Examples
> 
> x <- seq(-10, 50, 0.1 )
> 
> plot(LogLin(x, a=5) ~ x, type="l")
> grid()
> lines(LogLin(x, a=2) ~ x, col="brown")
> lines(LogLin(x, a=0.5) ~ x, col="steelblue")
> 
> lines(LogGen(x, a=1) ~ x, col="orange")
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>