2
$\begingroup$

I have a smooth function in GAM model with EDF 0.899 and EDF 0.000

I have two questions:

  1. What happens if the GAM model has a smoothing function with a low EDF value, EDF < 1 or maybe 0?
  2. Does the EDF value close to 1 (0.899) also indicate that it is linear?
$\endgroup$

1 Answer 1

3
$\begingroup$

It isn't possible to get a model with smooths that individually have EDFs < 1 in a standard GAM. Hence I presume you are also penalizing the null space of the penalty for the smooth.

Assuming you are (either via select = TRUE or using a shrinkage smooths bs = 'ts' or bs = 'cs' in {mgcv}) then:

Q1

Nothing happens. If the EDF is effectively equal to 0 then the term has been effectively removed from the model

More generally, the coefficients for a smooth have been shrunk towards 0 such that together, they contribute fewer than 1 degree of freedom to the model.

This is similar to the way that ridge regression, or models that use lasso or elastic net penalties (for example), also shrink the coefficients away from their unpenalised values.

Q2

No, it doesn't always indicate that the estimated effect is linear. You can have models where a non-linear function is estimated with EDF < 1. In those circumstances, the null space of the penalty has been shrunk a lot, as have the coefficients for the more wiggly basis functions, while one of the less wiggly basis functions hasn't been shrunk as much. In that situation you can still get a situation where one of the non-linear basis functions is accounting for most of the EDF and all the other functions have been shrunk to very close to zero.

The penalty null space, by the way, is the space of functions which the wigliness penalty doesn't affect. By default, for a univariate smooth, this will be the space of linear functions (as the constant term has been removed via identifiability constraints). The linear function is in the penalty null space by default because the default penalty is based on the curvature of the function (the second derivative) and a linear (straight line) function has 0 curvature everywhere. As such it doesn't contribute to the (default) penalty.

If you were to use a penalty on the first derivative instead of the second, then the linear (straight line) function would contribute to the penalty as it has a non-zero slope everywhere--- note that I'm excluding the constant function from this discussion as it would still have been removed via application of identifiability constraints as the model also contains an intercept.

$\endgroup$
4
  • $\begingroup$ Could you clarify a bit? Q1 "EDF is effectively equal to 0 then the term has been effectively removed from the model" - should it then be interpreted that the term does not have an influence on the response variable (regardless of p)? Q2 Are there cases where EDF close to 1 could be interpreted as linear? For example, I found this question because my EDF values of some terms are 0.9 and 0.95. $\endgroup$
    – kl-higgins
    Commented May 6 at 17:54
  • 1
    $\begingroup$ Q1 "effectively" no effect. The effect likely isn't zero but it will be small if the EDF is shrunk close to zero. Q2; yes, but you can also have EDF <1 and it be curved if you have select = TRUE. If you don't have that option on and use m=2 (for the default splines) then EDF = 1 is a linear effect. $\endgroup$ Commented May 6 at 18:44
  • $\begingroup$ I have a variable with the edf much less than 0... $\endgroup$
    – Chao
    Commented Aug 8 at 12:42
  • $\begingroup$ @chao That's not possible; are you sure it's not a number so small it's written in scientific notation $\endgroup$ Commented Aug 8 at 17:07

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.