biogeme.models.boxcox module

Implements the Box-Cox model

author:

Michel Bierlaire

date:

Wed Oct 25 08:52:44 2023

biogeme.models.boxcox.boxcox(x, ell)[source]

Box-Cox transform

\[B(x, \ell) = \frac{x^{\ell}-1}{\ell}.\]

It has the property that

\[\lim_{\ell \to 0} B(x,\ell)=\log(x).\]

To avoid numerical difficulties, if \(\ell < 10^{-5}\), the McLaurin approximation is used:

\[\log(x) + \ell \log(x)^2 + \frac{1}{6} \ell^2 \log(x)^3 + \frac{1}{24} \ell^3 \log(x)^4.\]
Parameters:
  • x (Expression | float | int | bool) – a variable to transform.

  • ell (Expression | float | int | bool) – parameter of the transformation.

Return type:

Expression

Returns:

the Box-Cox transform