Skip to main content

boxcox

Function boxcox 

Source
pub fn boxcox(x: f64, lambda: f64) -> f64
Expand description

Box-Cox transformation

The Box-Cox transformation is:

  • x.ln() if lambda == 0.0
  • (x.powf(lambda) - 1.0) / lambda if lambda != 0.0

Returns f64::NAN if x < 0.0. Returns f64::NEG_INFINITY if x == 0.0 && lambda < 0.0.

Corresponds to scipy.special.boxcox.

ยงSee also

  • inv_boxcox: Inverse of the Box-Cox transformation
  • boxcox1p: Box-Cox transformation of 1 + x