Power transform explained

In statistics, a power transform is a family of functions applied to create a monotonic transformation of data using power functions. It is a data transformation technique used to stabilize variance, make the data more normal distribution-like, improve the validity of measures of association (such as the Pearson correlation between variables), and for other data stabilization procedures.

Power transforms are used in multiple fields, including multi-resolution and wavelet analysis,[1] statistical data analysis, medical research, modeling of physical processes,[2] geochemical data analysis,[3] epidemiology[4] and many other clinical, environmental and social research areas.

Definition

The power transformation is defined as a continuous function of power parameter λ, typically given in piece-wise form that makes it continuous at the point of singularity (λ = 0). For data vectors (y1,..., yn) in which each yi > 0, the power transform is

(λ)
y
i
λ-1}{λ(\operatorname{GM}(y))
= \begin{cases} \dfrac{y
i

λ

}, &\text \lambda \neq 0 \\[12pt]\operatorname(y)\ln, &\text \lambda = 0\end

where

\operatorname{GM}(y)=

n
\left(\prod
i=1
1
n
y
i\right)

=\sqrt[n]{y1y2yn}

is the geometric mean of the observations y1, ..., yn. The case for

λ=0

is the limit as

λ

approaches 0. To see this, note that
λ
y
i

=\exp({λln(yi)})=1+λln(yi)+O((λ

2)
ln(y
i))
- using Taylor series. Then
λ-1}λ
\dfrac{y
i

=ln(yi)+O(λ)

, and everything but

ln(yi)

becomes negligible for

λ

sufficiently small.
(λ)
y
i
, because the units of measurement do not change as λ changes.

Box and Cox (1964) introduced the geometric mean into this transformation by first including the Jacobian of rescaled power transformation

yλ-1
λ.

with the likelihood. This Jacobian is as follows:

J(λ;y1,\ldots,yn)=

n
\prod
i=1

|d

(λ)
y
i

/dy| =

n
\prod
i=1
λ-1
y
i

=\operatorname{GM}(y)n(λ-1)

This allows the normal log likelihood at its maximum to be written as follows:

\begin{align} log(l{L}(\hat\mu,\hat\sigma))&=(-n/2)(log(2\pi\hat\sigma2)+1)+ n(λ-1)log(\operatorname{GM}(y))\\[5pt] &=(-n/2)(log(2\pi\hat\sigma2/\operatorname{GM}(y)2(λ-1))+1). \end{align}

From here, absorbing

\operatorname{GM}(y)2(λ-1)

into the expression for

\hat\sigma2

produces an expression that establishes that minimizing the sum of squares of residuals from
(λ)
y
i
is equivalent to maximizing the sum of the normal log likelihood of deviations from

(yλ-1)/λ

and the log of the Jacobian of the transformation.

The value at Y = 1 for any λ is 0, and the derivative with respect to Y there is 1 for any λ. Sometimes Y is a version of some other variable scaled to give Y = 1 at some sort of average value.

The transformation is a power transformation, but done in such a way as to make it continuous with the parameter λ at λ = 0. It has proved popular in regression analysis, including econometrics.

Box and Cox also proposed a more general form of the transformation that incorporates a shift parameter.

\tau(yi;λ,\alpha)=\begin{cases}\dfrac{(yi+\alpha)λ-1}{λ(\operatorname{GM}(y+\alpha))λ

} & \text \lambda\neq 0, \\ \\\operatorname(y+\alpha)\ln(y_i + \alpha)& \text \lambda=0,\endwhich holds if yi + α > 0 for all i. If τ(Y, λ, α) follows a truncated normal distribution, then Y is said to follow a Box–Cox distribution.

Bickel and Doksum eliminated the need to use a truncated distribution by extending the range of the transformation to all y, as follows:

\tau(yi;λ,\alpha)=\begin{cases} \dfrac{\operatorname{sgn}(yi+\alpha)|yi+\alpha|λ-1}{λ(\operatorname{GM}(y+\alpha))λ

} & \text \lambda\neq 0, \\ \\\operatorname(y+\alpha)\operatorname(y+\alpha)\ln(y_i + \alpha)& \text \lambda=0,\end

where sgn(.) is the sign function. This change in definition has little practical import as long as

\alpha

is less than

\operatorname{min}(yi)

, which it usually is.[5]

Bickel and Doksum also proved that the parameter estimates are consistent and asymptotically normal under appropriate regularity conditions, though the standard Cramér–Rao lower bound can substantially underestimate the variance when parameter values are small relative to the noise variance. However, this problem of underestimating the variance may not be a substantive problem in many applications.

Box–Cox transformation

The one-parameter Box–Cox transformations are defined as

(λ)
y
i

= \begin{cases}

λ
\dfrac{y
i

-1}{λ}&ifλ0,\\ lnyi&ifλ=0, \end{cases}

and the two-parameter Box–Cox transformations as

(\boldsymbol{λ
y
i

)}= \begin{cases} \dfrac{(yi+

λ1
λ
2)

-1}{λ1}&ifλ10,\\ ln(yi+λ2)&ifλ1=0, \end{cases}

as described in the original article.[6] [7] Moreover, the first transformations hold for

yi>0

, and the second for

yi>2

.

The parameter

λ

is estimated using the profile likelihood function and using goodness-of-fit tests.[8]

Confidence interval

Confidence interval for the Box–Cox transformation can be asymptotically constructed using Wilks's theorem on the profile likelihood function to find all the possible values of

λ

that fulfill the following restriction:[9]

ln(L(λ))\geln(L(\hatλ))-

1
2
2}
{\chi
1,1-\alpha

.

Example

The BUPA liver data set[10] contains data on liver enzymes ALT and γGT. Suppose we are interested in using log(γGT) to predict ALT. A plot of the data appears in panel (a) of the figure. There appears to be non-constant variance, and a Box–Cox transformation might help.

The log-likelihood of the power parameter appears in panel (b). The horizontal reference line is at a distance of χ12/2 from the maximum and can be used to read off an approximate 95% confidence interval for λ. It appears as though a value close to zero would be good, so we take logs.

Possibly, the transformation could be improved by adding a shift parameter to the log transformation. Panel (c) of the figure shows the log-likelihood. In this case, the maximum of the likelihood is close to zero suggesting that a shift parameter is not needed. The final panel shows the transformed data with a superimposed regression line.

Note that although Box–Cox transformations can make big improvements in model fit, there are some issues that the transformation cannot help with. In the current example, the data are rather heavy-tailed so that the assumption of normality is not realistic and a robust regression approach leads to a more precise model.

Econometric application

Economists often characterize production relationships by some variant of the Box–Cox transformation.[11]

Consider a common representation of production Q as dependent on services provided by a capital stock K and by labor hours N:

\tau(Q)=\alpha\tau(K)+(1-\alpha)\tau(N).

Solving for Q by inverting the Box–Cox transformation we find

Q=(\alphaKλ+(1-\alpha)Nλ)1/λ,

which is known as the constant elasticity of substitution (CES) production function.

The CES production function is a homogeneous function of degree one.

When λ = 1, this produces the linear production function:

Q=\alphaK+(1-\alpha)N.

When λ → 0 this produces the famous Cobb–Douglas production function:

Q=K\alphaN1-\alpha.

Activities and demonstrations

The SOCR resource pages contain a number of hands-on interactive activities[12] demonstrating the Box–Cox (power) transformation using Java applets and charts. These directly illustrate the effects of this transform on Q–Q plots, X–Y scatterplots, time-series plots and histograms.

Yeo–Johnson transformation

The Yeo–Johnson transformation[13] allows also for zero and negative values of

y

.

λ

can be any real number, where

λ=1

produces the identity transformation.The transformation law reads:
(λ)
y
i

=\begin{cases}

λ-1)/λ
((y
i+1)

&ifλ0,y\geq0\\[4pt]ln(yi+1)&ifλ=0,y\geq0\\[4pt] -((-yi+1)(2-λ)-1)/(2-λ)&ifλ2,y<0\\[4pt] -ln(-yi+1)&ifλ=2,y<0 \end{cases}

References

External links

Notes and References

  1. Book: Gao. Peisheng. Wu. Weilin. Sixth International Conference on Intelligent Systems Design and Applications . Power Quality Disturbances Classification using Wavelet and Support Vector Machines . 2006. 1. ISDA '06. Washington, DC, USA. IEEE Computer Society. 201–206. 10.1109/ISDA.2006.217. 9780769525280. 2444503 .
  2. Gluzman. S.. Yukalov. V. I.. 2006-01-01. Self-similar power transforms in extrapolation problems. Journal of Mathematical Chemistry. en. 39. 1. 47–56. 10.1007/s10910-005-9003-7. 1572-8897. cond-mat/0606104. 2006cond.mat..6104G. 118965098 .
  3. Howarth. R. J.. Earle. S. A. M.. 1979-02-01. Application of a generalized power transformation to geochemical data. Journal of the International Association for Mathematical Geology. en. 11. 1. 45–62. 10.1007/BF01043245. 121582755 . 1573-8868.
  4. Peters . J. L. . Rushton . L. . Sutton . A. J. . Jones . D. R. . Abrams . K. R. . Mugglestone . M. A. . 10.1111/j.1467-9876.2005.00476.x . Bayesian methods for the cross-design synthesis of epidemiological and toxicological evidence . Journal of the Royal Statistical Society, Series C . 54 . 159–172 . 2005 . 121909404 .
  5. Bickel . Peter J. . Doksum . Kjell A.. Peter J. Bickel. June 1981 . An analysis of transformations revisited. Journal of the American Statistical Association. 76 . 374. 296–311 . 10.1080/01621459.1981.10477649.
  6. Box . George E. P. . George E. P. Box . Cox . D. R. . David Cox (statistician) . An analysis of transformations . Journal of the Royal Statistical Society, Series B . 26 . 2 . 211–252 . 1964 . 192611 . 2984418 .
  7. Book: Johnston, J. . John Johnston (econometrician) . Econometric Methods . New York . McGraw-Hill . Third . 1984 . 978-0-07-032685-9 . 61–74 .
  8. Asar . O. . Ilk . O. . Dag . O. . Estimating Box-Cox power transformation parameter via goodness-of-fit tests . Communications in Statistics - Simulation and Computation . 46 . 1 . 91–105 . 2017 . 10.1080/03610918.2014.957839. 1401.3812 . 41501327 .
  9. Book: Abramovich . Felix . Ya'acov . Ritov . Statistical Theory: A Concise Introduction . CRC Press . 2013 . 121–122 . 978-1-4398-5184-5 .
  10. https://web.archive.org/web/20171023174701/http://ftp.ics.uci.edu:80/pub/machine-learning-databases/liver-disorders/ BUPA liver disorder dataset
  11. Book: Zarembka, P. . Transformation of Variables in Econometrics . Frontiers in Econometrics . New York . Academic Press . 1974 . 0-12-776150-0 . 81–104 .
  12. http://wiki.stat.ucla.edu/socr/index.php/SOCR_EduMaterials_Activities_PowerTransformFamily_Graphs Power Transform Family Graphs
  13. Yeo . In-Kwon . Johnson . Richard A. . A New Family of Power Transformations to Improve Normality or Symmetry . . 87 . 4 . 954–959 . 2000 . 2673623 . 10.1093/biomet/87.4.954 .