This repository contains R code for
-
simulating data based on the assumptions of a multivariate probit occupancy model with correlated species occurrences
-
fitting the multi-species occupancy model and its latent-factor approximation to the simulated data
-
fitting a multivariate probit regression model to the matrix of simulated species occurrences
-
fitting the two multi-species occupancy models to the Tibetan Plateau data
The following publication contains a complete description of these models and the MCMC algorithms used to fit them.
The original MCMC algorithm used to fit the multivariate probit (MP) occupancy model (Appendix S1), included updates of Zi,j that failed to properly account for the correlations in occurrence between species. The corrected MCMC algorithm is described in
AppendixS1_correctedMCMC.pdf
-
MultispeciesOccModel_SimulateData.R - simulates data based on the assumptions of a multivariate probit (MP) occupancy model
-
MultispeciesOccModel_MCMC.R - fits a multivariate probit (MP) occupancy model to data using an efficient MCMC algorithm
-
MultispeciesOccModel_correctedMCMC.R - fits a multivariate probit (MP) occupancy model to data using the corrected MCMC algorithm
-
MultispeciesOccModel_LV_JAGS.R - fits a latent factor (LF) occupancy model to data using JAGS
-
MvProbitModel_MCMC.R - fits a multivariate probit regression model (MvP) to latent occurrences using an efficient MCMC algorithm
-
SimulationStudy-Driver.R - calls functions to simulate a data set and then fit each model to this data set
-
realdata.rds - RDS file containing the camera-trap survey data of mammalian species on the Tibetan Plateau
-
FitMPmodelToTibetanData.R - driver for fitting the MP model to the Tibetan Plateau data
-
FitLVmodelToTibetanData.R - driver for fitting the LF model to the Tibetan Plateau data
-
EstimatePosteriorStats.R -- estimates posterior summary statistics from Markov chains
-
AppendixS1_MCMC.pdf -- description of MCMC algorithm used to fit the multivariate probit (MP) occupancy model
-
AppendixS1_correctedMCMC.pdf -- description of corrected MCMC algorithm used to fit the multivariate probit (MP) occupancy model
mvtnorm, tmvtnorm, msm, MASS, clusterGeneration, mcmcse, coda, rjags
Robert Dorazio (rmdorazio@gmail.com) and Lingyun Xiao (Lingyun.Xiao@xjtlu.edu.cn)