Hierarchical Modelling of Species Communities (HMSC) is a model-based approach for analyzing community ecological data (Ovaskainen et a.2017a).

The obligatory data for HMSC-analyses includes a matrix of species occurrences or abundances and a matrix of environmental covariates. Additional and optional data include information about species traits and phylogenetic relationships, and information about the spatiotemporal context of the sampling design. HMSC partitions variation in species occurrences to components that relate to environmental filtering, species interactions, and random processes. HMSC yields inference both at species and community levels. It can be used to generate simulated communities under given environmental conditions, and thus its predictions can be compared to independent validation data, and it can be used for scenario simulations.


The current version of the R-package Hmsc is found on CRAN. For a description of the software, see

The development version is found on Github.

The old matlab and R versions of HMSC can be found here.

HMSC book

The first copies of the book now exist, fresh from the printing press!

The official publication date (for both the printed book and the ebook) for the UK and Europe has been set as 11th June 2020. Further global publication dates will depend on shipping schedules and will be available on

Click here to order from the publisher's site - use offer code JSDM2020 to get 20% off.

Executable scripts

As supporting information to the book, we provide here R-scripts and data files for the three real data examples of the book: the plant example of Section 6.7, the fungal example of Section 7.9, and the bird example of Section 11.1. The scripts were originally developed by Otso Ovaskainen and Nerea Abrego, and Jari Oksanen has made further improvements to them.

HMSC workshop at OIKOS FINLAND 2025

We will be holding an HMSC pre-conference workshop at the Oikos Finland meeting. The all-day workshop will be on Tuesday March 11th. More details will follow later.

HMSC workshop at ISEC 2024

We will be holding an HMSC pre-conference workshop at the International Statistical Ecology Conference ISEC 2024 (15-19 July 2024, Swansea, UK). The all-day workshop will be on Sunday July 14th.

Instructors: Otso Ovaskainen (University of Jyväskylä, Finland) and Gleb Tikhonov (University of Helsinki, Finland)

Overview: In this workshop, the participants learn how to apply the Joint Species Distribution Modelling Framework of Hierarchical Modelling of Species Communities (HMSC) with the R-package Hmsc-R. HMSC can be used to model multispecies data on species occurrences/abundances as a function of environmental, spatial and temporal predictors, species traits and taxonomies/phylogenies. The workshop includes brief lectures introducing the conceptual and statistical background of HMSC. The main part of the workshop consists of computer demonstrations showing how to apply Hmsc-R to various types of data, such as hierarchical, spatial and temporal sampling designs, as well as dataset including traits and taxonomical/phylogenetic information. Compared to earlier HMSC courses organized in 2020 and 2022, this course includes as new elements instructions on how to fit HMSC up to 1000 times faster with the newly released high-performance computing module Hmsc-HPC, as well as new methods on how to link HMSC outputs to niche theory by summarizing them into shared and idiosyncratic responses of the species to measured and latent predictors. Participants working already with HMSC on their own data are provided one-to-one support. 
Intended audience: PhD students & researchers working with community data (=multispecies data) or developing statistical methods in this area. The course should be interesting for a broad set of ecologist and statistical ecologists.


Core papers about HMSC

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

Ovaskainen, O., Tikhonov, G., Dunson, D., Grøtan, V., Engen, S., Sæther, B.-E. and Abrego, N. 2017b. How are species interactions structured in species rich communities? A new method for analysing time-series data. Proceedings of the Royal Society B: Biological Sciences, 284, 20170768.

Tikhonov, G., Abrego, N., Dunson, D. and Ovaskainen, O. 2017. Using joint species distribution models for evaluating how species-to-species associations depend on the environmental context. Methods in Ecology and Evolution 8, 443-452.

Tikhonov, G., Opedal, Ø. H., Abrego, N., Lehikoinen, A., de Jonge, M. M., Oksanen, J. and Ovaskainen, O. 2020a. Joint species distribution modelling with the R-package Hmsc. Methods in Ecology and Evolution, in early view,

Tikhonov, G., Duan, L., Abrego, N., Newell, G., White, M., Dunson, D. and Ovaskainen, O. 2020b. Computationally efficient joint species distribution modelling of big spatial data. Ecology, e02929.

Ovaskainen, O. and Abrego, N. 2020. Joint Species Distribution Modelling – With Applications in R. Cambridge University Press, in press.

Abrego, N., Norberg, A. and Ovaskainen, O. 2017. Measuring and predicting the influence of traits on the assembly processes of wood-inhabiting fungi. Journal of Ecology 105, 1070-1081.

Ovaskainen, O., Roy, D., Fox, R. and Anderson, B. 2016. Uncovering hidden spatial structure in species communities with spatially explicit joint species distribution models. Methods in Ecology and Evolution 7, 428-436.

Ovaskainen, O., Abrego, N., Halme, P. and Dunson, D. 2016. Using latent variable models to identify large networks of species-to-species associations at different spatial scales. Methods in Ecology and Evolution 7, 549-555.

A review of joint species distribution modelling:

Warton, D., Blanchet, G., O’Hara, R., Ovaskainen, O., Taskinen, S., Walker, S. and Hui, F. K. C. 2015. So many variables: joint modelling in community ecology. Trends in Ecology and Evolution 30, 766-779.

How HMSC results link to the underlying community assembly processes:

Ovaskainen, O., Rybicki, J. and Abrego, N. 2019. What can observational data reveal about metacommunity processes? Ecography 42, 1877-1886.

The predictive performance of HMSC in comparison to other SDM methods:

Norberg, A., Abrego, N., Blanchet, F. G., Adler, F., Anderson, B., Anttila, J., Araújo, M., Dallas, T., Dunson, D., Elith, J., Foster, S., Fox, R., Franklin, J., Godsoe, W., Guisan, A., O'Hara, B., Hill, N., Holt, R. D., Hui, F., Husby, M., Kålås, J., Lehikoinen, A., Luoto, M., Mod, H., Newell, G., Renner, I., Roslin, T., Soininen, J., Thuiller, W., Vanhatalo, J., Warton, D., White, M., Zimmermann, N., Gravel, D. and Ovaskainen, O. 2019. A comprehensive evaluation of predictive performance of 33 species distribution models at species and community levels. Ecological Monographs 89, e01370.

Some empirically oriented papers applying HMSC:

Norberg, A., Halme, P., Kotiaho, J. S., Toivanen, T. and Ovaskainen, O. 2019. Experimentally induced community assembly of polypores reveals the importance of both environmental filtering and assembly history. Fungal Ecology 41, 137-146.

Minard, G., Tikhonov, G., Ovaskainen, O. and Saastamoinen, M. 2019. The microbiome of the Melitaea cinxia butterfly shows marked variation but is only little explained by the traits of the butterfly or its hostplant. Environmental Microbiology 21, 4253-4269.

Rocha, R., Ovaskainen, O., López-Baucells, A., Farneda, F. Z., Sampaio, E. M., Bobrowiec, P.E.D, Cabeza, M., Palmeirim, J. M. and Meyer, C. F. J. 2018. Secondary forest regeneration benefits old-growth specialist bats in a fragmented tropical landscape. Scientific Reports 8, 3819.

Häkkilä, M., Abrego, N., Ovaskainen, O. and Mönkkönen, M. 2018. Habitat quality is more important than matrix quality for bird communities in protected areas. Ecology and Evolution 8, 4019-4030.

Lammel, D. R., Barth, G., Ovaskainen, O., Cruz, L. M., Zanatta, J. A., Ryo, M., Souza, E. M. and Pedrosa, F. O. 2018. Direct and indirect effects of a pH gradient bring insights into the mechanisms driving prokaryotic community structures. Microbiome 6, 106.

Abrego, N., Dunson, D., Halme, P., Salcedo, I. and Ovaskainen, O. 2017. Wood-inhabiting fungi with tight associations with other species have declined as a response to forest management. Oikos 126, 269-275.

Rocha, R., Ovaskainen, O., López-Baucells, A., Farneda, F. Z., Ferreira, D. F., Bobrowiec, P.E.D, Cabeza, M., Palmeirim, J. M. and Meyer, C. F. J. 2017. Design matters: an evaluation of the impact of small man-made forest clearings on tropical bats using a before-after-control-impact design. Forest Ecology and Management 401, 8-16.