Gaussianize Cauchy in R the Lambert Way

Here I show you how you can make a random Cauchy sample look like a Gaussian (and here is the accompanying paper with theory and methodology). The data is transformed by a non-linear, but bijective transformation – thus you can go back and forth between Cauchy and Gaussian-like.

library(LambertW)
set.seed(10)
nn <- 100
yy <- rcauchy(n = nn)
normfit(yy) # definitely not Gaussian
xx <- Gaussianize(yy, method="MLE")
normfit(xx) # Gaussian

# what does the Lambert W x Gaussian model look like?
mod <- MLE_LambertW(yy, type="h")
summary(mod)
plot(mod)