-
Notifications
You must be signed in to change notification settings - Fork 11
/
6-covariates.Rmd
39 lines (23 loc) · 1.97 KB
/
6-covariates.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# Covariates {#covariateschapter}
WORK IN PROGRESS
## Covariate selection with reversible jump MCMC
RJMCMC in @gimenez2009fitness on Common blackbirds or @gimenez2009winbugs on White stork.
As an illustration, we use data on the white stork *Ciconia ciconia* population in Baden Wurttemberg (Germany), consisting of 321 capture histories of individuals ringed as chicks between 1956 and 1971. From the 60's to the 90's, all Western European stork populations were declining @bair91. This trend was likely the result of reduced food availability @schau05 caused by severe droughts observed in the wintering ground of storks in the Sahel region. This hypothesis has been examined in several studies (@kanya90 and @barb99).
Check out <https://r-nimble.org/nimbleExamples/RJMCMC_example.html> and <https://r-nimble.org/variable-selection-in-nimble-using-reversible-jump-mcmc>.
Somewhere explain how to use if-else in model code to consider alternative models, w/ some covariate in/out. Avoids rewriting all models, we see what's changed, and it avoids errors. Example:
```{r eval = FALSE}
if(covariate){
logit(survival[t]) <- beta[1] + beta[2] *x[t]
}else{
logit(survival[t]) <- beta[1]
}#ifelse
```
then specify "covariate=TRUE/FALSE".
## Missing values {#naincov}
Work on missing values by @bonner2006 (see @gimenez2009winbugs) and @langrock2013maximum and @worthington2015. See also @rose2018.
## Sex uncertainty
@pradel2008sex and @genovart_exploiting_2012
## Nonlinearities
Splines à la @gimenez_semiparametric_2006, possibly w/ jagam <https://rdrr.io/cran/mgcv/src/R/jagam.r>.
## Spatial
3D Splines as in @Peron2011. (I)CAR as in @saracco2010icar (see (<https://github.com/Andrew9Lawson/Bayesian-DM-code-examples>, <https://github.com/Andrew9Lawson/Bayesian_DM_Nimble_code/tree/ICAR-and-other-code> and <https://r-nimble.org/html_manual/cha-spatial.html> for NIMBLE implementation). Add RSR @khan2022rsr (see Jags code at <https://gist.github.com/oliviergimenez/0d5519654adef09060581eb49e2128ce>).