Backfitting algorithm

From testwiki
Jump to navigation Jump to search

Template:Short description In statistics, the backfitting algorithm is a simple iterative procedure used to fit a generalized additive model. It was introduced in 1985 by Leo Breiman and Jerome Friedman along with generalized additive models. In most cases, the backfitting algorithm is equivalent to the Gauss–Seidel method, an algorithm used for solving a certain linear system of equations.

Algorithm

Additive models are a class of non-parametric regression models of the form:

Yi=α+j=1pfj(Xij)+ϵi

where each X1,X2,,Xp is a variable in our p-dimensional predictor X, and Y is our outcome variable. ϵ represents our inherent error, which is assumed to have mean zero. The fj represent unspecified smooth functions of a single Xj. Given the flexibility in the fj, we typically do not have a unique solution: α is left unidentifiable as one can add any constants to any of the fj and subtract this value from α. It is common to rectify this by constraining

i=1Nfj(Xij)=0 for all j

leaving

α=1/Ni=1Nyi

necessarily.

The backfitting algorithm is then:

   Initialize α^=1/Ni=1Nyi,fj^0,j
   Do until fj^ converge:
       For each predictor j:
           (a) fj^Smooth[{yiα^kjfk^(xik)}1N] (backfitting step)
           (b) fj^fj^1/Ni=1Nfj^(xij) (mean centering of estimated function)

where Smooth is our smoothing operator. This is typically chosen to be a cubic spline smoother but can be any other appropriate fitting operation, such as:

In theory, step (b) in the algorithm is not needed as the function estimates are constrained to sum to zero. However, due to numerical issues this might become a problem in practice.[1]

Motivation

If we consider the problem of minimizing the expected squared error:

minE[Y(α+j=1pfj(Xj))]2

There exists a unique solution by the theory of projections given by:

fi(Xi)=E[Y(α+jipfj(Xj))|Xi]

for i = 1, 2, ..., p.

This gives the matrix interpretation:

(IP1P1P2IP2PpPpI)(f1(X1)f2(X2)fp(Xp))=(P1YP2YPpY)

where Pi()=E(|Xi). In this context we can imagine a smoother matrix, Si, which approximates our Pi and gives an estimate, SiY, of E(Y|X)

(IS1S1S2IS2SpSpI)(f1f2fp)=(S1YS2YSpY)

or in abbreviated form

S^f=QY

An exact solution of this is infeasible to calculate for large np, so the iterative technique of backfitting is used. We take initial guesses fj(0) and update each fj() in turn to be the smoothed fit for the residuals of all the others:

fj^()Smooth[{yiα^kjfk^(xik)}1N]

Looking at the abbreviated form it is easy to see the backfitting algorithm as equivalent to the Gauss–Seidel method for linear smoothing operators S.

Explicit derivation for two dimensions

Following,[2] we can formulate the backfitting algorithm explicitly for the two dimensional case. We have:

f1=S1(Yf2),f2=S2(Yf1)

If we denote f^1(i) as the estimate of f1 in the ith updating step, the backfitting steps are

f^1(i)=S1[Yf^2(i1)],f^2(i)=S2[Yf^1(i)]

By induction we get

f^1(i)=Yα=0i1(S1S2)α(IS1)Y(S1S2)i1S1f^2(0)

and

f^2(i)=S2α=0i1(S1S2)α(IS1)Y+S2(S1S2)i1S1f^2(0)

If we set f^2(0)=0 then we get

f^1(i)=YS21f^2(i)=[Iα=0i1(S1S2)α(IS1)]Y
f^2(i)=[S2α=0i1(S1S2)α(IS1)]Y

Where we have solved for f^1(i) by directly plugging out from f2=S2(Yf1).

We have convergence if S1S2<1. In this case, letting f^1(i),f^2(i)f^1(),f^2():

f^1()=YS21f^2()=Y(IS1S2)1(IS1)Y
f^2()=S2(IS1S2)1(IS1)Y

We can check this is a solution to the problem, i.e. that f^1(i) and f^2(i) converge to f1 and f2 correspondingly, by plugging these expressions into the original equations.

Issues

The choice of when to stop the algorithm is arbitrary and it is hard to know a priori how long reaching a specific convergence threshold will take. Also, the final model depends on the order in which the predictor variables Xi are fit.

As well, the solution found by the backfitting procedure is non-unique. If b is a vector such that S^b=0 from above, then if f^ is a solution then so is f^+αb is also a solution for any α. A modification of the backfitting algorithm involving projections onto the eigenspace of S can remedy this problem.

Modified algorithm

We can modify the backfitting algorithm to make it easier to provide a unique solution. Let 𝒱1(Si) be the space spanned by all the eigenvectors of Si that correspond to eigenvalue 1. Then any b satisfying S^b=0 has bi𝒱1(Si)i=1,,p and i=1pbi=0. Now if we take A to be a matrix that projects orthogonally onto 𝒱1(S1)++𝒱1(Sp), we get the following modified backfitting algorithm:

   Initialize α^=1/N1Nyi,fj^0,i,j, f+^=α+f1^++fp^
   Do until fj^ converge:
       Regress yf+^ onto the space 𝒱1(Si)++𝒱1(Sp), setting a=A(Yf+^)
       For each predictor j:
           Apply backfitting update to (Ya) using the smoothing operator (IAi)Si, yielding new estimates for fj^

Template:More footnotes

References

Template:Reflist

  1. Hastie, Trevor, Robert Tibshirani and Jerome Friedman (2001). The Elements of Statistical Learning: Data Mining, Inference, and Prediction. Springer, Template:ISBN.
  2. Härdle, Wolfgang; et al. (June 9, 2004). "Backfitting". Archived from the original on 2015-05-10. Retrieved 2015-08-19.