4
$\begingroup$

I'm trying to find issues where GLMs are better than GAMs and came to the idea that GLMs can make predictions beyond the scope of the data used to feed the model (i.e, extrapolations), while GAMs cannot:

Suppose we have a set of X and Y observations. The X observations are spread inside the domain [x0, x1]. If we fit a GLM to X vs Y we obtain a mathematical relation between X and Y (in the most simple case, Y = b0*X + b1). Therefore, we can obtain for every X_i of our choice a modelled Y_i. We surely should have a good estimate if X_i is inside [x0,x1] but nothing speaks about giving a try also for values outside this range (another story is that the estimate is "good").

Now, GAMs are based on smooth functions obtained from the X-Y scatter, but they give no (simple) mathematical relation between X and Y. You get an Y estimate for each X observation you have and can make a nice plot. Surely you can interpolate any Y value between observations to obtain an estimate of your choice, but considering we have only X data inside the range [x0, x1] you cannot predict (or extrapolate) a Y value with a GAM for an X value lying outside the range [x0, x1]. With no mathematical relation linking X and Y, you cannot extrapolate!

So, if I understand correctly and the answer to my question is "no", I would say the extrapolation or predicting potential of a GLM is surely a very strong advantage in comparison to a GAM!

$\endgroup$
3
  • $\begingroup$ I think you're correct, as long as you can assume that the estimates are the same even for higher or lower values of x than observed. For example, if we consider prices on used cars and all our data are from cars that are 5-10 years old, then we might see a nice (negative) linear relationship between car age and price. But this will be quite useless to assess prices on cars that are 1-2 years old, as the reduction in price is more steep initially. So assuming that the estimated coefficient remains stable, I think you're correct. $\endgroup$
    – JonB
    Commented Oct 14, 2015 at 13:14
  • 2
    $\begingroup$ Using natural splines you can do some limited extrapolation. $\endgroup$ Commented May 9, 2019 at 10:57
  • $\begingroup$ This site gives some good info on extrapolating with GAMs: fromthebottomoftheheap.net/2020/06/03/extrapolating-with-gams $\endgroup$ Commented Oct 24, 2020 at 9:10

1 Answer 1

2
$\begingroup$

Four years have passed by and now I'm able of answering my own question. This is indeed a no, you cannot really extrapolate data with a GAM, only in a very limited range quite close to x0 or x1. If you are using splines, you would be extrapolating with a cubic polynomial, which is not very good, since the curve would quickly tend to -infinity or +infinity. There is an example in Simon Wood's book "Generalized Additive Models: An Introduction with R" (exercise 5 in page 400) about this, where it is shown that the extrapolation capacity of a GAM is very limited. I believe indeed that GLMs should be better to extrapolate data.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.