I am using the mgcv
package in R to fit a GAM to some hydrologic data as follows:
d <- GAM_example_data[,1:4]
colnames(d) <- c("month","rain","pump","GWL")
fitted_GAM <- gam(GWL~s(month) + s(rain) + s(pump), data = d)
plot.gam(fitted_GAM)
When I get the plots that are output from plot.gam
, on the y-axis it tells me the degrees of freedom for each of the smoothing functions, and these are often non-integer values. I wish to be able to control the degrees of freedom for each of the smooth functions used, is there a way to do this?
I have seen references to specifying the "knots" and therefore controlling the fit but I am fairly new to the concept of GAMs and I haven't been able to find any clear resources explaining what these are (if they are even related to my problem at all).