Alternating conditional expectations

From HandWiki
Revision as of 11:00, 24 October 2022 by Steve Marsio (talk | contribs) (correction)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Alternating conditional expectations (ACE) is an algorithm to find the optimal transformations between the response variable and predictor variables in regression analysis.[1]

Introduction

In statistics, nonlinear transformation of variables is commonly used in practice in regression problems. Alternating conditional expectations (ACE) is one of the methods to find those transformations that produce the best fitting additive model. Knowledge of such transformations aids in the interpretation and understanding of the relationship between the response and predictors.

ACE transform the response variable [math]\displaystyle{ Y }[/math] and its predictor variables, [math]\displaystyle{ X_i }[/math] to minimize the fraction of variance not explained. The transformation is nonlinear and is obtained from data in an iterative way.

Mathematical description

Let [math]\displaystyle{ Y,X_1,\dots,X_p }[/math] be random variables. We use [math]\displaystyle{ X_1,\dots,X_p }[/math] to predict [math]\displaystyle{ Y }[/math]. Suppose [math]\displaystyle{ \theta(Y),\varphi_1(X_1),\dots,\varphi_p(X_p) }[/math] are zero-mean functions and with these transformation functions, the fraction of variance of [math]\displaystyle{ \theta(Y) }[/math] not explained is

[math]\displaystyle{ e^2(\theta,\varphi_1,\dots,\varphi_p)=\frac{\mathbb{E}\left[\theta(Y)-\sum_{i=1}^p \varphi_i(X_i)\right]^2}{\mathbb{E}[\theta^2(Y)]} }[/math]

Generally, the optimal transformations that minimize the unexplained part are difficult to compute directly. As an alternative, ACE is an iterative method to calculate the optimal transformations. The procedure of ACE has the following steps:

  1. Hold [math]\displaystyle{ \phi_1(X_1),\dots,\phi_p(X_p) }[/math] fixed, minimizing [math]\displaystyle{ e^2 }[/math]gives [math]\displaystyle{ \theta_1(Y)=\mathbb{E}\left[\sum_{i=1}^p \varphi_i(X_i)\Bigg|Y\right] }[/math]
  2. Normalize [math]\displaystyle{ \theta_1(Y) }[/math] to unit variance.
  3. For each [math]\displaystyle{ k }[/math], fix other [math]\displaystyle{ \varphi_i(X_i) }[/math] and [math]\displaystyle{ \theta(Y) }[/math], minimizing [math]\displaystyle{ e^2 }[/math] and the solution is:: [math]\displaystyle{ \tilde{\varphi}_k = \mathbb{E}\left[\theta(Y)-\sum_{i\neq k} \varphi_i(X_i) \Bigg| X_k\right] }[/math]
  4. Iterate the above three steps until [math]\displaystyle{ e^2 }[/math] is within error tolerance.

Bivariate case

The optimal transformation [math]\displaystyle{ \theta^*(Y), \varphi^*(X) }[/math] for [math]\displaystyle{ p=1 }[/math] satisfies

[math]\displaystyle{ \rho^*(X, Y) = \rho^*(\theta^*, \varphi^*) = \max_{\theta, \varphi} \rho(\theta(Y), \varphi(X)) }[/math]

where [math]\displaystyle{ \rho }[/math] is Pearson correlation coefficient. [math]\displaystyle{ \rho^*(X, Y) }[/math] is known as the maximal correlation between [math]\displaystyle{ X }[/math] and [math]\displaystyle{ Y }[/math]. It can be used as a general measure of dependence.

In the bivariate case, ACE algorithm can also be regarded as a method for estimating the maximal correlation between two variables.

Software implementation

The ACE algorithm was developed in the context of known distributions. In practice, data distributions are seldom known and the conditional expectation should be estimated from data. R language has a package acepack which implements ACE algorithm. The following example shows its usage:

library(acepack)
TWOPI <- 8 * atan(1)
x <- runif(200, 0, TWOPI)
y <- exp(sin(x) + rnorm(200)/2)
a <- ace(x, y)
par(mfrow=c(3,1))
plot(a$y, a$ty)  # view the response transformation
plot(a$x, a$tx)  # view the carrier transformation
plot(a$tx, a$ty) # examine the linearity of the fitted model

Discussion

The ACE algorithm provides a fully automated method for estimating optimal transformations in multiple regression. It also provides a method for estimating maximal correlation between random variables. Since the process of iteration usually terminates in a limited number of runs, the time complexity of the algorithm is [math]\displaystyle{ O(np) }[/math] where [math]\displaystyle{ n }[/math] is the number of samples. The algorithm is reasonably computer efficient.

A strong advantage of the ACE procedure is the ability to incorporate variables of quite different type in terms of the set of values they can assume. The transformation functions [math]\displaystyle{ \theta(y), \varphi_i(x_i) }[/math] assume values on the real line. Their arguments can, however, assume values on any set. For example, ordered real and unordered categorical variables can be incorporated in the same regression equation. Variables of mixed type are admissible.

As a tool for data analysis, the ACE procedure provides graphical output to indicate a need for transformations as well as to guide in their choice. If a particular plot suggests a familiar functional form for a transformation, then the data can be pre-transformed using this functional form and the ACE algorithm can be rerun.

As with any regression procedure, a high degree of association between predictor variables can sometimes cause the individual transformation estimates to be highly variable, even though the complete model is reasonably stable. When this is suspected, running the algorithm on randomly selected subsets of the data, or on bootstrap samples can assist in assessing the variability.

References

  1. Breiman, L. and Friedman, J. H. Estimating optimal transformations for multiple regression and correlation. J. Am. Stat. Assoc., 80(391):580–598, September 1985b. This article incorporates text from this source, which is in the public domain.