Using power transformations
Power functions are mathematical transformations that follow , where lambda can take any value. The square and cube root transformations are special cases of power transformations where lambda is 1/2 or 1/3, respectively. The challenge resides in finding the value for the lambda parameter. The Box-Cox transformation, which is a generalization of the power transformations, finds the optimal lambda via maximum likelihood. We will discuss the Box-Cox transformation in the following recipe. In practice, we try different lambdas and visually inspect the variable distribution to determine which one offers the best transformation. In general, if the data is right-skewed – that is, observations accumulate toward lower values – we use lambda <1, while if the data is left-skewed – that is, there are more observations around higher values – then we use lambda >1.
In this recipe, we will carry out power transformations using NumPy...