R-CMD-check CRAN Status DOI Downloads

hSDM is an R package for estimating parameters of hierarchical Bayesian species distribution models. Such models allow interpreting the observations (occurrence and abundance of a species) as a result of several hierarchical processes including ecological processes (habitat suitability, spatial dependence and anthropogenic disturbance) and observation processes (species detectability). Hierarchical species distribution models are essential for accurately characterizing the environmental response of species, predicting their probability of occurrence, and assessing uncertainty in the model results.


Install the latest stable version of hSDM from CRAN with:

Or install the development version of hSDM from GitHub with:


Vignettes and manual

In the wild


The hSDM R package is Open Source and released under the GNU GPL version 3 license. Anybody who is interested can contribute to the package development following our Contributing guide. Every contributor must agree to follow the project’s Code of conduct.


Diez J. M. and Pulliam H. R. 2007. Hierarchical analysis of species distributions and abundance across environmental gradients. Ecology. 88(12): 3144-3152.

Gelfand A. E., Silander J. A., Wu S. S., Latimer A., Lewis P. O., Rebelo A. G. and Holder M. 2006. Explaining species distribution patterns through hierarchical modeling. Bayesian Analysis. 1(1): 41-92.

Latimer, A. M.; Wu, S. S.; Gelfand, A. E. & Silander, J. A. 2006. Building statistical models to analyze species distributions. Ecological Applications. 16(1): 33-50.

MacKenzie, D. I.; Nichols, J. D.; Lachman, G. B.; Droege, S.; Andrew Royle, J. and Langtimm, C. A. 2002. Estimating site occupancy rates when detection probabilities are less than one. Ecology. 83: 2248-2255.

Royle, J. A. 2004. N-mixture models for estimating population size from spatially replicated counts. Biometrics. 60: 108-115.