R-users E-mail: r-help@r-project.org I have a quenstion on "gam()" in "gam" package. The help of gam() says: 'gam' uses the _backfitting algorithm_ to combine different smoothing or fitting methods. On the other hand, lm.wfit(), which is a routine of gam.fit() contains: z <- .Fortran("dqrls", qr = x * wts, n = n, p = p, y = y * wts, ny = ny, tol = as.double(tol), coefficients = mat.or.vec(p, ny), residuals = y, effects = mat.or.vec(n, ny), rank = integer(1), pivot = 1:p, qraux = double(p), work = double(2 * p), PACKAGE = "base") It may indicate that QR decomposition is used to derive an additive model instead of backfitting. I am wondering if my guess is correct, or this "the _backfitting algorithm" has another meaning. ******** E-mail: takezawa@affrc.go.jp ******** ***** http://cse.naro.affrc.go.jp/takezawa/intro.html ***** [[alternative HTML version deleted]]
R-users E-mail: r-help@r-project.org>Please don't ask the same question multiple times!I am really sorry about it. I thought that my first mail did not work.>And no, backfitting and QR are unrelated concepts. You need to read up >on the theory,To derive an additive model, we have two methods: (1) backfitting, (2) solving multiple linear equation using QR decomposition.>If i read the code correctly, lm.wfit is called iteratively in gam.fit, >via the line > fit <- eval(bf.call) >The iteration is necessary to the backfitting algorithm.This iteration seems to be for "iteratively reweighted least squares" not for backfitting. And lm.wfit may solve multiple linear equation using QR decomposition; but I am not sure. -- ***** r.otasuke@gmail.com ***** http://cse.naro.affrc.go.jp/takezawa/intro.html [[alternative HTML version deleted]]
R-users E-mail: r-help@r-project.org> This iteration seems to be for "iteratively reweighted least squares" not >for backfitting. And lm.wfit may solve multiple linear equation using >QR decomposition; but I am not sure.Let me tell you something about my guess above. The iteration below is from 1 to maxit. for (iter in 1:maxit) { ------ fit <- eval(bf.call) ------ } The help of "gam.control()" says: maxit: maximum number of local scoring iterations bf.maxit: maximum number of backfitting iterations Therefore the iteration above is local scoring iteration not backfitting iteration. The first line of "lm.wfit()" is: function (x, y, w, offset = NULL, method = "qr", tol = 1e-07, singular.ok = TRUE, ...) There is no "bf.maxit" or its equivalent in these arguments. And it contains 'method = "qr"'; it may mean that this routine solves a multiple linear equation using QR decomposition. -- ***** r.otasuke@gmail.com ***** http://cse.naro.affrc.go.jp/takezawa/intro.html [[alternative HTML version deleted]]