Girish Mahajan (Editor)

Backfitting algorithm

Updated on
Edit
Like
Comment
Share on FacebookTweet on TwitterShare on LinkedInShare on Reddit

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 algorithm for solving a certain linear system of equations.

Contents

Algorithm

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

Y i = α + j = 1 p f j ( X i j ) + ϵ i

where each X 1 , X 2 , , X p 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 f j represent unspecified smooth functions of a single X j . Given the flexibility in the f j , we typically do not have a unique solution: α is left unidentifiable as one can add any constants to any of the f j and subtract this value from α . It is common to rectify this by constraining

i = 1 N f j ( X i j ) = 0 for all j

leaving

α = 1 / N i = 1 N y i

necessarily.

The backfitting algorithm is then:

Initialize α ^ = 1 / N i = 1 N y i , f j ^ 0 , j Do until f j ^ converge: For each predictor j: (a) f j ^ Smooth [ { y i α ^ k j f k ^ ( x i k ) } 1 N ] (backfitting step) (b) f j ^ f j ^ 1 / N i = 1 N f j ^ ( x i j ) (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:

  • local polynomial regression
  • kernel smoothing methods
  • more complex operators, such as surface smoothers for second and higher-order interactions
  • 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.

    Motivation

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

    min E [ Y ( α + j = 1 p f j ( X j ) ) ] 2

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

    f i ( X i ) = E [ Y ( α + j i p f j ( X j ) ) | X i ]

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

    This gives the matrix interpretation:

    ( I P 1 P 1 P 2 I P 2 P p P p I ) ( f 1 ( X 1 ) f 2 ( X 2 ) f p ( X p ) ) = ( P 1 Y P 2 Y P p Y )

    where P i ( ) = E ( | X i ) . In this context we can imagine a smoother matrix, S i , which approximates our P i and gives an estimate, S i Y , of E ( Y | X )

    ( I S 1 S 1 S 2 I S 2 S p S p I ) ( f 1 f 2 f p ) = ( S 1 Y S 2 Y S p Y )

    or in abbreviated form

    S ^ f = Q Y

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

    f i ^ ( j ) Smooth [ { y i α ^ k j f k ^ ( x i k ) } 1 N ]

    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

    For the two dimensional case, we can formulate the backfitting algorithm explicitly. We have:

    f 1 = S 1 ( Y f 2 ) , f 2 = S 2 ( Y f 1 )

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

    f ^ 1 ( i ) = S 1 [ Y f ^ 2 ( i 1 ) ] , f ^ 2 ( i ) = S 2 [ Y f ^ 1 ( i 1 ) ]

    By induction we get

    f ^ 1 ( i ) = Y α = 0 i 1 ( S 1 S 2 ) α ( I S 1 ) Y ( S 1 S 2 ) i 1 S 1 f ^ 2 ( 0 )

    and

    f ^ 2 ( i ) = S 2 α = 0 i 1 ( S 1 S 2 ) α ( I S 1 ) Y + S 2 ( S 1 S 2 ) i 1 S 1 f ^ 2 ( 0 )

    If we assume our constant α is zero and we set f ^ 2 ( 0 ) = 0 then we get

    f ^ 1 ( i ) = [ I α = 0 i 1 ( S 1 S 2 ) α ( I S 1 ) ] Y f ^ 2 ( i ) = [ S 2 α = 0 i 1 ( S 1 S 2 ) α ( I S 1 ) ] Y

    This converges if S 1 S 2 < 1 .

    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 X i 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 α R . 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 V 1 ( S i ) be the space spanned by all the eigenvectors of Si that correspond to eigenvalue 1. Then any b satisfying S ^ b = 0 has b i V 1 ( S i ) i = 1 , , p and i = 1 p b i = 0. Now if we take A to be a matrix that projects orthogonally onto V 1 ( S 1 ) + + V 1 ( S p ) , we get the following modified backfitting algorithm:

    Initialize α ^ = 1 / N 1 N y i , f j ^ 0 , i , j , f + ^ = α + f 1 ^ + + f p ^ Do until f j ^ converge: Regress y f + ^ onto the space V 1 ( S i ) + + V 1 ( S p ) , setting a = A ( Y f + ^ ) For each predictor j: Apply backfitting update to ( Y a ) using the smoothing operator ( I A i ) S i , yielding new estimates for f j ^

    References

    Backfitting algorithm Wikipedia