<p>This is a problem I'm currently facing as well. I find that GAMs are a lot easier to present and understand, which is important when you want your readers and reviewers to easily digest your methods &amp; results. One simple solution is to include a lagged dependent variable as a categorical predictor in your model formula, but this might have undesirable impacts on your analysis.</p>
<p>Check out these articles for warnings on this approach:</p>
<ul>
<li><a href="http://www-personal.umich.edu/%7Efranzese/Achen.2000.LDVstealingExplanPower.pdf" rel="nofollow noreferrer">Achen C. H. (2001)Why lagged dependent variables can suppress the
explanatory power of other independent variables</a></li>
<li><a href="https://www.jstor.org/stable/pdf/25791844.pdf?casa_token=TDt-guKpTFsAAAAA:MnYZ98hBQyhWqlU8nMrFlnaZKtkiv9CkXsV7mlC1jB528TrHJtYimR17wm0-KqGHIMKXv90mHNwXpm3FjKobqVkx2uq40EE6w9pJDNWCOH5I3NYCd3_J" rel="nofollow noreferrer">Keele, L. and    Kelly N. J. (2005) Dynamic models for dynamic
theories: the ins and    outs of lagged dependent variables</a></li>
</ul>
<p>Ultimately, I think accounting for the temporal autocorrelation is probably best handeled in a GAMM or GEEGLM framework, but we might need to take extra care to support reader and reviewer comprehension because it's easy for the math behind these approaches to make one's head spin.</p>
<p>Here's a <a href="https://stats.stackexchange.com/questions/110757/residual-autocorrelation-versus-lagged-dependent-variable">related Cross Validated post</a> which might help you make a decision</p>

CC BY-SA 4.0
2022-07-13T23:21:52.560Z
I think Karlina Merkens did a nice job explaining the GEE methods in our 2019 paper looking at trends in sperm whale occurrence: https://www.int-res.com/abstracts/esr/v39/p115-133/
ASimonis
CC BY-SA 4.0
2022-07-14T00:56:23.790Z
The link to your "related Cross Validated post" is broken, taking you back to the bioacoustics stackexchange splash page.
dtsavage
CC BY-SA 4.0
2022-07-14T01:05:46.617Z
Woops - Thanks for letting me know about the broken link! It should work now
ASimonis
CC BY-SA 4.0
2022-07-13T23:17:06.260Z
2022-07-14T01:04:47.590Z
2022-07-14T01:04:47.590Z
ASimonis
<p>In our analysis of porpoise presence around a tidal turbine we fit a binomial gam using mgcv::<em>bam()</em>. The <em>bam</em> function allows you to add an AR1 autocorrelation structure to the residuals via the argument <em>rho</em> corresponding to a GEE-approximation. The help file for <em>bam()</em> explains the parameters you need to define, including AR.start which sets blocks that are permitted to be autocorrelated (like in a GEE). This was the best solution I could find.</p>
<p>References:
Palmer <em>et al.,</em> 2021. Harbour porpoise (Phocoena phocoena) presence is reduced during tidal turbine operation. <em>Aquatic Conservation</em>. <a href="https://doi.org/10.1002/aqc.3737" rel="nofollow noreferrer">https://doi.org/10.1002/aqc.3737</a></p>

CC BY-SA 4.0
2022-07-14T08:41:22.223Z
2022-07-14T08:41:22.223Z
Laura P
<p>Some researchers have also been combining GEE and GAMs in a new framework to look at temporal occurrence of cetacean in static acoustic recordings:</p>
<p>Pirotta, Enrico &amp; Matthiopoulos, Jason &amp; Mackenzie, Monique &amp; Scott-Hayward, Lindesay &amp; Rendell, Luke. (2011). Modelling Sperm Whale Habitat Preference: A Novel Approach Combining Transect and Follow Data. Marine Ecology Progress Series. 436. 257-272. 10.3354/meps09236.</p>
<p>Barile, Cynthia &amp; Berrow, Simon &amp; Parry, G &amp; O’Brien, Joanne. (2021). Temporal acoustic occurrence of sperm whales (Physeter macrocephalus) and long-finned pilot whales (Globicephala melas) off western Ireland. Marine Ecology Progress Series. 661. 203–227. 10.3354/meps13594.</p>

CC BY-SA 4.0
2022-07-14T11:01:37.303Z
2022-07-14T11:01:37.303Z
Morgane
<p>I've been working on a project where I'm using echolocation clicks recorded from a bottom-mounted, underwater passive acoustic recorder as a proxy for animal presence. I want to compare the presence timeseries I've created to various environmental conditions at the site, so I've been looking into modelling structures.</p>
<p>I'm curious whether others in this community have some perspective on using generalized additive models (gam in R) vs. generalized additive models with generalized estimating equations (geeglm in R) for this purpose. Geeglm is more robust to temporal autocorrelation, which can be a big issue in this dataset. However, gam modelling is much more common and as such has better documentation, more existing examples in literature, and clearer methods for evaluating model fit (in my opinion).</p>
<p>Do others have experience with either or both of these model types? Any advice is useful!</p>

CC BY-SA 4.0
2022-07-09T05:13:35.107Z
This may be a better fit on Cross Validated. :(
etgriffiths
CC BY-SA 4.0
2022-07-11T16:47:35.800Z
Hmm.. that may be a good point. I guess I was interested in getting the perspectives of other bioacousticians in particular, and am not sure if I'd reach our community specifically on Cross Validated. But then there's certainly something to be said for reaching a broader community (potentially including more statisticians) instead with a question like this.
MZiegenhorn
<marine-mammals><underwater><modelling>
GAM() vs GEEGLM() for analyzing acoustic data in R
# GAM() vs GEEGLM() for analyzing acoustic data in R

(Asked by: username_0 on 2022-07-08)

I've been working on a project where I'm using echolocation clicks recorded from a bottom-mounted, underwater passive acoustic recorder as a proxy for animal presence. I want to compare the presence timeseries I've created to various environmental conditions at the site, so I've been looking into modelling structures.

I'm curious whether others in this community have some perspective on using generalized additive models (gam in R) vs. generalized additive models with generalized estimating equations (geeglm in R) for this purpose. Geeglm is more robust to temporal autocorrelation, which can be a big issue in this dataset. However, gam modelling is much more common and as such has better documentation, more existing examples in literature, and clearer methods for evaluating model fit (in my opinion).

Do others have experience with either or both of these model types? Any advice is useful!

**Tags:** marine-mammals, underwater, modelling

> **Comments:**
> **username_1**: This may be a better fit on Cross Validated. :(  
> **username_0**: Hmm.. that may be a good point. I guess I was interested in getting the perspectives of other bioacousticians in particular, and am not sure if I'd reach our community specifically on Cross Validated. But then there's certainly something to be said for reaching a broader community (potentially including more statisticians) instead with a question like this.  

---

## 3 answers

### Answer by username_2 on 2022-07-13. Score: 4

This is a problem I'm currently facing as well. I find that GAMs are a lot easier to present and understand, which is important when you want your readers and reviewers to easily digest your methods & results. One simple solution is to include a lagged dependent variable as a categorical predictor in your model formula, but this might have undesirable impacts on your analysis.

Check out these articles for warnings on this approach:

* [Achen C. H. (2001)Why lagged dependent variables can suppress the
  explanatory power of other independent variables](http://www-personal.umich.edu/%7Efranzese/Achen.2000.LDVstealingExplanPower.pdf)
* [Keele, L. and Kelly N. J. (2005) Dynamic models for dynamic
  theories: the ins and outs of lagged dependent variables](https://www.jstor.org/stable/pdf/25791844.pdf?casa_token=TDt-guKpTFsAAAAA:MnYZ98hBQyhWqlU8nMrFlnaZKtkiv9CkXsV7mlC1jB528TrHJtYimR17wm0-KqGHIMKXv90mHNwXpm3FjKobqVkx2uq40EE6w9pJDNWCOH5I3NYCd3_J)

Ultimately, I think accounting for the temporal autocorrelation is probably best handeled in a GAMM or GEEGLM framework, but we might need to take extra care to support reader and reviewer comprehension because it's easy for the math behind these approaches to make one's head spin.

Here's a [related Cross Validated post](https://stats.stackexchange.com/questions/110757/residual-autocorrelation-versus-lagged-dependent-variable) which might help you make a decision

> **Comments:**
> **username_2**: I think Karlina Merkens did a nice job explaining the GEE methods in our 2019 paper looking at trends in sperm whale occurrence: https://www.int-res.com/abstracts/esr/v39/p115-133/  
> **username_3**: The link to your "related Cross Validated post" is broken, taking you back to the bioacoustics stackexchange splash page.  
> **username_2**: Woops - Thanks for letting me know about the broken link! It should work now  

---

### Answer by username_4 on 2022-07-14. Score: 4

In our analysis of porpoise presence around a tidal turbine we fit a binomial gam using mgcv::*bam()*. The *bam* function allows you to add an AR1 autocorrelation structure to the residuals via the argument *rho* corresponding to a GEE-approximation. The help file for *bam()* explains the parameters you need to define, including AR.start which sets blocks that are permitted to be autocorrelated (like in a GEE). This was the best solution I could find.

References:
Palmer *et al.,* 2021. Harbour porpoise (Phocoena phocoena) presence is reduced during tidal turbine operation. *Aquatic Conservation*. <https://doi.org/10.1002/aqc.3737>


---

### Answer by username_5 on 2022-07-14. Score: 4

Some researchers have also been combining GEE and GAMs in a new framework to look at temporal occurrence of cetacean in static acoustic recordings:

Pirotta, Enrico & Matthiopoulos, Jason & Mackenzie, Monique & Scott-Hayward, Lindesay & Rendell, Luke. (2011). Modelling Sperm Whale Habitat Preference: A Novel Approach Combining Transect and Follow Data. Marine Ecology Progress Series. 436. 257-272. 10.3354/meps09236.

Barile, Cynthia & Berrow, Simon & Parry, G & O’Brien, Joanne. (2021). Temporal acoustic occurrence of sperm whales (Physeter macrocephalus) and long-finned pilot whales (Globicephala melas) off western Ireland. Marine Ecology Progress Series. 661. 203–227. 10.3354/meps13594.


---

