Skip to contents

Fits a model of the form \(\hat{f}(x) = \hat{g}_{1}(x_S) + \hat{g}_{2}(x_C)\) using backfitting.

Usage

backfitter(
  X,
  y,
  predictor,
  fitMethod,
  predictfcn,
  eps = 0.01,
  iter.max = 10,
  verbose = TRUE,
  ...
)

Arguments

X

The design matrix.

y

The response vector.

predictor

The name or index of the predictor of interest (\(x_S\)).

fitMethod

A function that accepts X and y and returns a fitted model.

predictfcn

A function that accepts object and newdata and returns predictions.

eps

Convergence threshold.

iter.max

Maximum number of iterations.

verbose

If TRUE, prints progress messages.

...

Additional arguments passed to fitMethod.

Value

An object of class backfitter.