boxcox1p

mpsci.stats.boxcox1p(x, lmbda)

Box-Cox transformation of 1 + x.

The transformation is

\[\begin{split}f(x; \lambda) = \begin{cases} \log(x + 1) & \textrm{if} \; \lambda = 0 \\ \frac{(x + 1)^{\lambda} - 1}{\lambda} & \textrm{if} \; \lambda \ne 0 \end{cases}\end{split}\]

This function is mathematically equivalent to boxcox(1+x, lmbda). It avoids the loss of precision that can occur if x is very small.

See also: boxcox(), inv_boxcox1p()