Question: Yeo-Johnson and Logarithmic transformation
0
23 months ago by
rednalf60
rednalf60 wrote:

Is a Yeo-Johnson transformation using a lambda equal to 0 the same transformation as a logarithmic transformation?

modified 23 months ago by Kevin Blighe56k • written 23 months ago by rednalf60
1

I'm not sure, but I guess your question would be more appropriate on https://stats.stackexchange.com/

1

I think you're confusing it with the Box-Cox transformation. Look at the Wikipedia page on power transform to see the differences.

3
23 months ago by
Kevin Blighe56k
Kevin Blighe56k wrote:

Greetings,

They are not the same. Here is the proof:

``````require(VGAM)

# Create random data
x <- matrix(rexp(200, rate=.1), ncol=40)

y0 <- yeo.johnson(x, lambda=0)
y1 <- yeo.johnson(x, lambda=1)
y2 <- yeo.johnson(x, lambda=2)
logged <- log(x)

par(mfrow=c(2,3)); hist(x); hist(y0); hist(y1); hist(y2); hist(logged)
``````

``````mean(y0); sd(y0); range(y0)
[1] 2.02613
[1] 0.9372831
[1] 0.04263848 4.37854026

mean(logged); sd(logged); range(logged)
[1] 1.707483
[1] 1.379477
[1] -3.133603  4.365917
``````

Kevin

1

An empirical proof is nice but a mathematical proof is better because you then understand what you're doing. In this case, a quick look at the formula on Wikipedia is enough to show that they can't be the same: for x >= 0, yeo.johnson(x, lambda=0) = log(x+1) != log(x)