You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: vignettes/nmixtures.Rmd
+4-4
Original file line number
Diff line number
Diff line change
@@ -289,7 +289,7 @@ plot_latentN(hc, testdat, species = 'sp_2')
289
289
290
290
We can see that estimates for both species have correctly captured the true temporal variation in abundance. However, it is also apparent that low detection probabilities (like for species 2) make it difficult to accurately estimate latent abundance. We could likely improve these estimates if we had some additional information that could inform our estimates of detection probability, such as covariates that reflect our ability to take accurate measurements
291
291
292
-
## Example 2: a larger survey with nonlinear effects
292
+
## Example 2: a larger survey with possible nonlinear effects
293
293
294
294
Now for another example with a larger dataset. We will use data from [Jeff Doser's simulation example from the wonderful `spAbundance` package](https://www.jeffdoser.com/files/spabundance-web/articles/nmixturemodels){target="_blank"}. The simulated data include one continuous site-level covariate, one factor site-level covariate and two continuous sample-level covariates. This example will allow us to examine how we can include possibly nonlinear effects in the latent process and detection probability models.
295
295
@@ -389,12 +389,12 @@ mod <- mvgam(
389
389
mod <- mvgam(
390
390
# effects of covariates on detection probability;
391
391
# here we use penalized splines for both continuous covariates
392
-
formula = y ~ s(det_cov, k = 3) + s(det_cov2, k = 3),
392
+
formula = y ~ s(det_cov, k = 4) + s(det_cov2, k = 4),
393
393
394
394
# effects of the covariates on latent abundance;
395
395
# here we use a penalized spline for the continuous covariate and
396
396
# hierarchical intercepts for the factor covariate
397
-
trend_formula = ~ s(abund_cov, k = 3) +
397
+
trend_formula = ~ s(abund_cov, k = 4) +
398
398
s(abund_fac, bs = 're'),
399
399
400
400
# link multiple observations to each site
@@ -475,7 +475,7 @@ plot_predictions(mod,
475
475
ylab('Pr(detection)')
476
476
```
477
477
478
-
The model has found support for some important covariate effects, but of course we'd want to interrogate how well the model predicts and think about possible spatial effects to capture unmodelled variation in latent abundance.
478
+
The model has found support for some important covariate effects, but of course we'd want to interrogate how well the model predicts and think about possible spatial effects to capture unmodelled variation in latent abundance (which can easily be incorporated into both linear predictors using spatial smooths).
479
479
480
480
## Further reading
481
481
The following papers and resources offer useful material about N-mixture models for ecological population dynamics investigations:
0 commit comments