jSDM-package

joint species distribution models

joint species distribution models

jSDM is an R package for fitting joint species distribution models (JSDM) in a hierarchical Bayesian framework.

The Gibbs sampler is written in 'C++'. It uses 'Rcpp', 'Armadillo' and 'GSL' to maximize computation efficiency.

Package:jSDM
Type:Package
Version:0.2.1
Date:2019-01-11
License:GPL-3
LazyLoad:yes
package

Details

The package includes the following functions to fit various species distribution models :

functiondata-type
jSDM_binomial_logitpresence-absence
jSDM_binomial_probitpresence-absence
jSDM_binomial_probit_sp_constrainedpresence-absence
jSDM_binomial_probit_long_formatpresence-absence
jSDM_poisson_logabundance
  • jSDM_binomial_probit :

    Ecological process:

yijBernoulli(θij)yij Bernoulli(θij), y_{ij} \sim \mathcal{B}ernoulli(\theta_{ij})y_ij ~ Bernoulli(\theta_ij),

where

if n_latent=0 and site_effect="none"probit (θij)=Xiβj(\theta_ij) = X_i \beta_j
if n_latent\>0 and site_effect="none"probit (θij)=Xiβj+Wiλj(\theta_ij) = X_i \beta_j + W_i \lambda_j
if n_latent=0 and site_effect="fixed"probit (θij)=Xiβj+αi(\theta_ij) = X_i \beta_j + \alpha_i and αi N(0,Vα)\alpha_i ~ N(0,V_\alpha)
if n_latent\>0 and site_effect="fixed"probit (θij)=Xiβj+Wiλj+αi(\theta_ij) = X_i \beta_j + W_i \lambda_j + \alpha_i
if n_latent=0 and site_effect="random"probit (θij)=Xiβj+αi(\theta_ij) = X_i \beta_j + \alpha_i
if n_latent\>0 and site_effect="random"probit (θij)=Xiβj+Wiλj+αi(\theta_ij) = X_i \beta_j + W_i \lambda_j + \alpha_i and αi N(0,Vα)\alpha_i ~ N(0,V_\alpha)
  • jSDM_binomial_probit_sp_constrained :

    This function allows to fit the same models than the function jSDM_binomial_probit except for models not including latent variables, indeed n_latent must be greater than zero in this function. At first, the function fit a JSDM with the constrained species arbitrarily chosen as the first ones in the presence-absence data-set. Then, the function evaluates the convergence of MCMC λ\lambda chains using the Gelman-Rubin convergence diagnostic (R^\hat{R}). It identifies the species (j^l\hat{j}_l) having the higher R^\hat{R} for λj^l\lambda_{\hat{j}_l}. These species drive the structure of the latent axis ll. The λ\lambda corresponding to this species are constrained to be positive and placed on the diagonal of the Λ\Lambda matrix for fitting a second model. This usually improves the convergence of the latent variables and factor loadings. The function returns the parameter posterior distributions for this second model.

  • jSDM_binomial_logit :

    Ecological process :

yijBinomial(θij,ti)yij Binomial(θij,ti), y_{ij} \sim \mathcal{B}inomial(\theta_{ij},t_i)y_ij ~ Binomial(\theta_ij,t_i),

where

if n_latent=0 and site_effect="none"logit (θij)=Xiβj(\theta_ij) = X_i \beta_j
if n_latent\>0 and site_effect="none"logit (θij)=Xiβj+Wiλj(\theta_ij) = X_i \beta_j + W_i \lambda_j
if n_latent=0 and site_effect="fixed"logit (θij)=Xiβj+αi(\theta_ij) = X_i \beta_j + \alpha_i
if n_latent\>0 and site_effect="fixed"logit (θij)=Xiβj+Wiλj+αi(\theta_ij) = X_i \beta_j + W_i \lambda_j + \alpha_i
if n_latent=0 and site_effect="random"logit (θij)=Xiβj+αi(\theta_ij) = X_i \beta_j + \alpha_i and αi N(0,Vα)\alpha_i ~ N(0,V_\alpha)
if n_latent\>0 and site_effect="random"logit (θij)=Xiβj+Wiλj+αi(\theta_ij) = X_i \beta_j + W_i \lambda_j + \alpha_i and αi N(0,Vα)\alpha_i ~ N(0,V_\alpha)
  • jSDM_poisson_log :

    Ecological process :

yijPoisson(θij)yij Poisson(θij), y_{ij} \sim \mathcal{P}oisson(\theta_{ij})y_ij ~ Poisson(\theta_ij),

where

if n_latent=0 and site_effect="none"log (θij)=Xiβj(\theta_ij) = X_i \beta_j
if n_latent\>0 and site_effect="none"log (θij)=Xiβj+Wiλj(\theta_ij) = X_i \beta_j + W_i \lambda_j
if n_latent=0 and site_effect="fixed"log (θij)=Xiβj+αi(\theta_ij) = X_i \beta_j + \alpha_i
if n_latent\>0 and site_effect="fixed"log (θij)=Xiβj+Wiλj+αi(\theta_ij) = X_i \beta_j + W_i \lambda_j + \alpha_i
if n_latent=0 and site_effect="random"log (θij)=Xiβj+αi(\theta_ij) = X_i \beta_j + \alpha_i and αi N(0,Vα)\alpha_i ~ N(0,V_\alpha)
if n_latent\>0 and site_effect="random"log (θij)=Xiβj+Wiλj+αi(\theta_ij) = X_i \beta_j + W_i \lambda_j + \alpha_i and αi N(0,Vα)\alpha_i ~ N(0,V_\alpha)
  • jSDM_binomial_probit_long_format :

    Ecological process:

ynBernoulli(θn)yn Bernoulli(θn) y_n \sim \mathcal{B}ernoulli(\theta_n)y_n ~ Bernoulli(\theta_n)

such as speciesn=jspecies_n=j and siten=isite_n=i, where

if n_latent=0 and site_effect="none"probit (θn)=Dnγ+Xnβj(\theta_n) = D_n \gamma + X_n \beta_j
if n_latent\>0 and site_effect="none"probit (θn)=Dnγ+Xnβj+Wiλj(\theta_n) = D_n \gamma + X_n \beta_j + W_i \lambda_j
if n_latent=0 and site_effect="fixed"probit (θn)=Dnγ+Xnβj+αi(\theta_n) = D_n \gamma + X_n \beta_j + \alpha_i and αi N(0,Vα)\alpha_i ~ N(0,V_\alpha)
if n_latent\>0 and site_effect="fixed"probit (θn)=Dnγ+Xnβj+Wiλj+αi(\theta_n) = D_n \gamma + X_n \beta_j + W_i \lambda_j + \alpha_i
if n_latent=0 and site_effect="random"probit (θn)=Dnγ+Xnβj+αi(\theta_n) = D_n \gamma + X_n \beta_j + \alpha_i
if n_latent\>0 and site_effect="random"probit (θn)=Dnγ+Xnβj+Wiλj+αi(\theta_n) = D_n \gamma + X_n \beta_j + W_i \lambda_j + \alpha_i and αi N(0,Vα)\alpha_i ~ N(0,V_\alpha)

References

Chib, S. and Greenberg, E. (1998) Analysis of multivariate probit models. Biometrika, 85, 347-361.

Warton, D. I.; Blanchet, F. G.; O'Hara, R. B.; O'Hara, R. B.; Ovaskainen, O.; Taskinen, S.; Walker, S. C. and Hui, F. K. C. (2015) So Many Variables: Joint Modeling in Community Ecology. Trends in Ecology & Evolution, 30, 766-779.

Ovaskainen, O., Tikhonov, G., Norberg, A., Blanchet, F. G., Duan, L., Dunson, D., Roslin, T. and Abrego, N. (2017) How to make more out of community data? A conceptual framework and its implementation as models and software. Ecology Letters, 20, 561-576.

Author(s)

Ghislain Vieilledent ghislain.vieilledent@cirad.fr

Jeanne Clément jeanne.clement16@laposte.net

Frédéric Gosselin frederic.gosselin@inrae.fr