# Unusual residual artefacts in GLMM, is GAM or another model more appropriate?

I'm having trouble finding an appropriate model for my data. The data comprises behavioural observations of chimpanzees, where I instantaneously sampled their locomotor behaviours and parameters of the environment in which they were moving every minute. I'm interested in how age influences the types of locomotor behaviours (Modes), and the use of their environment (height in trees, diameter of branches used). I've been trying to build different models to ask a couple of different questions each with different response variables, but for simplicity I will just provide one example here.

structure(list( ID = c("BEL", "BEL", "BEL", "MYS", "MYS", "PAN", "PAN", "PAN",
"PAN", "PAN", "PAN", "PAN", "PAN", "PAN", "PAN", "PAN", "FAU",
"FAU", "FAU", "FAU"), Height1 = c(4, 34, 19, 9, 9, 4, 9, 4, 4,
4, 4, 39, 34, 9, 4, 4, 24, 4, 9, 19), Dia_fac = structure(c(2L,
3L, 2L, 3L, 1L, 2L, 3L, 2L, 2L, 3L, 2L, 3L, 2L, 3L, 2L, 3L, 3L,
3L, 3L, 3L), .Label = c(">0_4cm", "20_80cm", "4_20cm"), class = "factor"),
Age_2018 = c(42, 42, 42, 43, 43, 23, 23, 23, 23, 23, 23,
23, 23, 23, 23, 23, 19, 19, 19, 19), Age2 = structure(c(6L,
6L, 6L, 6L, 6L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,
1L, 1L, 1L, 1L), .Label = c("<20", "20-25", "25-30", "30-35",
"35-40", "40-45", "45-50", "50-55"), class = "factor"), Mode = c("Pronograde_Compressive",
"Vertical_Climb", "Vertical_Descent", "Vertical_Climb", "Vertical_Climb"
)), row.names = c(NA, -20L), class = c("tbl_df", "tbl", "data.frame"
))


For this model I want to know whether height in the tree is influenced by age. Locomotor mode and diameter of branch used are included as co-variates, as these will probably vary with height and possibly age, and I want to be able to account for these in the model. So far I have tried modelling this with log-linear, however the contingency table suffered from a large number of zeros, even after recategorisation of the variables.

Next I tried using GLMMs, and after having gone through several different iterations of the modelling process, I can't seem to get a model that has an appropriate specification. Currently my best model is the following, which specifies a zero inflated GLMM with a negative binomial distribution, and includes a random effect for ID. However there seems to be some unusual artefacts in residuals as seen in the DHARMa output below.

glmmTMB(Height1 ~ Mode * Dia_fac * scale(Age_2018)  + (1 | ID), ziformula = ~ Age_2018 + (Age_2018 | ID) , family = "nbinom1", data = df3)


After discussion with my supervisor, we think that we may need to specify higher-order terms, so the next step might be to try modelling with a GAM in order to help identify the terms we need to produce a well-fitted model (perhaps then returning to GLMMs with the terms we have identified). However this is not something either of us have experience of, and I was looking for some validation about whether this is the right sort of approach, or if we are missing something that we can model with the GLMM?