Skip to content

Commit 733bcbc

Browse files
author
Nicholas Clark
committed
update site
1 parent db20148 commit 733bcbc

File tree

6 files changed

+12
-11
lines changed

6 files changed

+12
-11
lines changed

R/stan_utils.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ remove_likelihood = function(model_file){
4242
# trend_formula model
4343
if(any(grepl('lv_coefs = Z;',
4444
stan_file, fixed = TRUE)) &
45-
!any(grepl('// ma error parameters',
45+
!any(grepl('vector[n_lv] LV[n];',
4646
stan_file, fixed = TRUE))){
4747
stan_file <- stan_file[-grep('lv_coefs = Z;',
4848
stan_file, fixed = TRUE)]

R/sysdata.rda

-69 Bytes
Binary file not shown.

docs/articles/nmixtures.html

+7-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/mvgam.dll

0 Bytes
Binary file not shown.

tests/testthat/Rplots.pdf

2 Bytes
Binary file not shown.

vignettes/nmixtures.Rmd

+4-4
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ plot_latentN(hc, testdat, species = 'sp_2')
289289

290290
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
291291

292-
## Example 2: a larger survey with nonlinear effects
292+
## Example 2: a larger survey with possible nonlinear effects
293293

294294
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.
295295

@@ -389,12 +389,12 @@ mod <- mvgam(
389389
mod <- mvgam(
390390
# effects of covariates on detection probability;
391391
# 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),
393393
394394
# effects of the covariates on latent abundance;
395395
# here we use a penalized spline for the continuous covariate and
396396
# hierarchical intercepts for the factor covariate
397-
trend_formula = ~ s(abund_cov, k = 3) +
397+
trend_formula = ~ s(abund_cov, k = 4) +
398398
s(abund_fac, bs = 're'),
399399
400400
# link multiple observations to each site
@@ -475,7 +475,7 @@ plot_predictions(mod,
475475
ylab('Pr(detection)')
476476
```
477477

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).
479479

480480
## Further reading
481481
The following papers and resources offer useful material about N-mixture models for ecological population dynamics investigations:

0 commit comments

Comments
 (0)