How can I improve my bam model if 3/4 gam.check plots show poor diagnosis, except for the histogram of residuals (which shows a normal distribution).
My response variable is soundscape saturation (sat1db, continuous data) and the covariates are also continuos, the main important covariate is time_day and elevation. My limitation is that I have only 1 site per elevation (total sites =8). When I add the elevation data as numeric, I get an error that memory is limited. Thus, I converted it to factor. Please advise if there is anything I could improve.
Below is my model:
gam2 <- bam(sat1db ~ s(time_day, by = elevation.factor, bs = "cc", k = 25)+
s(elevation.factor, bs = "re")+
s(elevation.factor, time_day, bs = "re"),
knots = list(time_day = c(0.05,23.54)), #23.54
data = mod.data.cc, method = "fREML",
select = TRUE, control = list(nthreads=6),
discrete = TRUE,
family = gaussian (link = "identity"))
Thank you in advance!
I tried changing the number of basis functions (k), and eliminating the last two smooth functions to reduce complexity. After comparing these options using the AICc model comparison, the model listed above (gam2) is still the best one. However, the gam.check is not performing well.
Carla Mere is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.