Discover millions of ebooks, audiobooks, and so much more with a free trial

Only $11.99/month after trial. Cancel anytime.

Applied Hierarchical Modeling in Ecology: Analysis of Distribution, Abundance and Species Richness in R and BUGS: Volume 2: Dynamic and Advanced Models
Applied Hierarchical Modeling in Ecology: Analysis of Distribution, Abundance and Species Richness in R and BUGS: Volume 2: Dynamic and Advanced Models
Applied Hierarchical Modeling in Ecology: Analysis of Distribution, Abundance and Species Richness in R and BUGS: Volume 2: Dynamic and Advanced Models
Ebook1,636 pages14 hours

Applied Hierarchical Modeling in Ecology: Analysis of Distribution, Abundance and Species Richness in R and BUGS: Volume 2: Dynamic and Advanced Models

Rating: 0 out of 5 stars

()

Read preview

About this ebook

Applied Hierarchical Modeling in Ecology: Analysis of Distribution, Abundance and Species Richness in R and BUGS, Volume Two: Dynamic and Advanced Models provides a synthesis of the state-of-the-art in hierarchical models for plant and animal distribution, also focusing on the complex and more advanced models currently available. The book explains all procedures in the context of hierarchical models that represent a unified approach to ecological research, thus taking the reader from design, through data collection, and into analyses using a very powerful way of synthesizing data.
  • Makes ecological modeling accessible to people who are struggling to use complex or advanced modeling programs
  • Synthesizes current ecological models and explains how they are inter-connected
  • Contains numerous examples throughout the book, walking the reading through scenarios with both real and simulated data
  • Provides an ideal resource for ecologists working in R software and in BUGS software for more flexible Bayesian analyses
LanguageEnglish
Release dateOct 10, 2020
ISBN9780128097274
Applied Hierarchical Modeling in Ecology: Analysis of Distribution, Abundance and Species Richness in R and BUGS: Volume 2: Dynamic and Advanced Models
Author

Marc Kéry

Dr. Marc works as a senior scientist at the Swiss Ornithological Institute, Seerose 1, 6204 Sempach, Switzerland. This is a non-profit NGO with about 160 employees dedicated primarily to bird research, monitoring, and conservation. Marc was trained as a plant population ecologist at the Swiss Universities of Basel and Zuerich. After a 2-year postdoc at the (then) USGS Patuxent Wildlife Center in Laurel, MD. During the last 20 years he has worked at the interface between population ecology, biodiversity monitoring, wildlife management, and statistics. He has published more than 100 peer-reviewed journal articles and five textbooks on applied statistical modeling. He has also been very active in teaching fellow biologists and wildlife managers the concepts and tools of modern statistical analysis in their fields in workshops all over the world, something which goes together with his books, which target the same audiences.

Read more from Marc Kéry

Related to Applied Hierarchical Modeling in Ecology

Related ebooks

Environmental Science For You

View More

Related articles

Related categories

Reviews for Applied Hierarchical Modeling in Ecology

Rating: 0 out of 5 stars
0 ratings

0 ratings0 reviews

What did you think?

Tap to rate

Review must be at least 10 words

    Book preview

    Applied Hierarchical Modeling in Ecology - Marc Kéry

    Applied Hierarchical Modeling in Ecology: Analysis of Distribution, Abundance and Species Richness in R and BUGS

    Volume 2: Dynamic and Advanced Models

    Marc Kéry

    Swiss Ornithological Institute, Sempach, Switzerland

    J. Andrew Royle

    USGS Patuxent Wildlife Research Center, Laurel MD, USA

    Table of Contents

    Cover image

    Title page

    Copyright

    Dedication

    Foreword

    Preface

    Acknowledgments

    Introduction

    Part 1. Models for Dynamic Systems

    Chapter 1. Relative Abundance Models for Population Dynamics

    1.1. Introduction

    1.2. Risks in the Naive Interpretation of Relative Abundance

    1.3. Crested Tit Count Data From the Swiss MHB Breeding Bird Survey

    1.4. Generalized Linear Models: A Site-By-Year Model

    1.5. Generalized Linear Mixed Models

    1.6. Gaussian State-Space Models for Inference About Relative Abundance

    1.7. Demographic State-Space Models for Inference About Relative Abundance

    1.8. Modeling Population Dynamics at Two Temporal Scales

    1.9. Summary and Outlook

    Chapter 2. Modeling Population Dynamics With Count Data

    2.1. Introduction

    2.2. Swiss MHB Data for the Green Woodpecker

    2.3. Year-Stratified N-Mixture Model

    2.4. Modeling Temporary Emigration (TE) with a Three-Level N-Mixture Model

    2.5. Dynamic N-Mixture Model of Dail-Madsen

    2.6. Robustness and Fit: Summary Thoughts on the Dail-Madsen Models (and on N-Mixture Models in General)

    2.7. Modeling Dynamics with Multinomial N-Mixture Models

    2.8. Multinomial Mixtures with Full Dynamics

    2.9. The Multi-state Dail-Madsen Model

    2.10. Spatially Dynamic Dail-Madsen Models

    2.11. Summary and Outlook

    Chapter 3. Hierarchical Models of Survival

    3.1. Introduction

    3.2. Basic Cormack-Jolly-Seber Models

    3.3. Hierarchical CJS Models to Combine Information Across, and Compare, Groups

    3.4. Spatial Hierarchical CJS Models

    3.5. Summary and Outlook

    Chapter 4. Modeling Species Distribution and Range Dynamics, and Population Dynamics Using Dynamic Occupancy Models

    4.1. Introduction to the Modeling of Presence/Absence Dynamics

    4.2. Derivation of the Dynocc Model from First Principles

    4.3. Simulation and Analysis of the Simplest Dynamic Occupancy Model

    4.4. A General Data Simulation Function for Dynocc Models

    4.5. Simulation and Analysis of a Time-dependent Data Set with unmarked and BUGS

    4.6. Trend Estimation with Occupancy Data

    4.7. Study Design, Bias, and Precision of Estimators

    4.8. Goodness-of-Fit

    4.9. Analysis and Mapping of Crossbill Distribution and Range Dynamics in Switzerland

    4.10. Analysis of Citizen Science Data Using Occupancy Models

    4.11. Accounting for Preferential Sampling in a Bird Population Study

    4.12. A Demographic Dynamic Occupancy Model

    4.13. Accounting for Temporary Emigration and Modeling Phenologies Using Occupancy Data: Estimation of Arrival and Departure in Insects or Migratory Animals

    4.14. Summary and Outlook

    Chapter 5. Modeling Metacommunity Dynamics Using Dynamic Community Models

    5.1. Introduction to Dynamic Community Models

    5.2. A General Simulation Function for the DCM

    5.3. Fitting the Simplest Dynamic Community Models

    5.4. Data Formatting for the DCM: Fun with Multidimensional Arrays

    5.5. Estimating Species Richness via the Random-Effects DCM with Data Augmentation

    5.6. Using the DCM in Meta-Analyses and Comparative Studies

    5.7. Case Study: Norwegian Birds

    5.8. Summary and Outlook

    Chapter 6. Multi-state Occupancy Models

    6.1. Introduction

    6.2. Derivation of Multi-state Occupancy Models

    6.3. Simulation and Analysis of Simple Multi-state Models and Dynamic Multi-state Models

    6.4. Case Study: Swiss Eagle Owls

    6.5. Summary and Outlook

    Part 2. Advanced Models

    Chapter 7. Modeling False Positives

    7.1. Introduction

    7.2. Basic Occupancy Models With False Positives

    7.3. Joint Modeling of Type 1 and Type 2 Data: the Multi-method Design of Miller et al. (2011)

    7.4. Modeling Classified False-Positive Detections: Multi-state Design of Miller et al. (2011)

    7.5. Bayesian Analysis of Models With False Positives in JAGS

    7.6. Modeling False Positives from Acoustic Monitoring Data

    7.7. False Positives Models in Open Populations

    7.8. Multispecies Misclassification Models

    7.9. Summary and Outlook

    Chapter 8. Modeling Interactions Among Species

    8.1. Introduction

    8.2. Joint Occupancy Models for Few Species with Symmetric Interactions

    8.3. Joint Occupancy Models for Few Species with Directional Interactions

    8.4. Joint Occupancy Models for Many Species: Joint Species Distribution Models (JSDMs)

    8.5. Joint Models for Abundance

    8.6. Summary and Outlook

    Chapter 9. Spatial Models of Distribution and Abundance

    9.1. Introduction

    9.2. Data Simulation for Spatial N-Mixture and Occupancy Models

    9.3. Fitting a Nonspatial N-Mixture Model to the Simulated Data

    9.4. Descriptive Models of Spatial Autocorrelation

    9.5. Fitting a Simple SVC Model: Spatial Modeling of Population Trend

    9.6. Mechanistic, or Dynamic, Models of Spatial Autocorrelation

    9.7. Summary and Outlook

    Chapter 10. Integrated Models for Multiple Types of Data

    10.1. Introduction to Integrated Models

    10.2. A Simulation Game to Improve Your Intuition About Point, Abundance, and Occurrence Patterns

    10.3. Example 1: Combination of Raw and Aggregated Occupancy Data

    10.4. Example 2: Combination of Counts Plus Detection/Nondetection Data

    10.5. Example 3: Combination of Counts Plus Abundance-Class Data

    10.6. Example 4: Combination of Counts Plus Opportunistic Presence-Only Data

    10.7. Example 5: A Simple Integrated Population Model

    10.8. Example 6: A Spatial Integrated Model Combining Spatial Capture-Recapture Data and Counts or Occupancy Data from Unmarked Individuals

    10.9. Summary and Outlook

    Chapter 11. Spatially Explicit Distance Sampling Along Transects

    11.1. Introduction

    11.2. Distance Sampling Model Components

    11.3. Distance Sampling Models on Linear Transects

    11.4. Mark-Recapture/Distance Sampling Models on Linear Transects

    11.5. Spatial Models for Transect Sampling

    11.6. Hierarchical Distance Sampling (HDS) with Multiple Transects

    11.7. Distance Sampling Models Based on Pixel Frequencies

    11.8. Temporary Emigration Distance Sampling Models

    11.9. Analysis of Wiggly Transects

    11.10. Fully Bayesian Density Surface Modeling (DSM)

    11.11. Summary and Outlook

    Chapter 12. Conclusions

    12.1. The Beauty, Power, and Utility of Hierarchical Models

    12.2. The Future of Hierarchical Models

    12.3. Concluding Remarks

    Author Index

    Subject Index

    Copyright

    Academic Press is an imprint of Elsevier

    125 London Wall, London EC2Y 5AS, United Kingdom

    525 B Street, Suite 1650, San Diego, CA 92101, United States

    50 Hampshire Street, 5th Floor, Cambridge, MA 02139, United States

    The Boulevard, Langford Lane, Kidlington, Oxford OX5 1GB, United Kingdom

    Copyright © 2021 Elsevier Inc. All rights reserved.

    No part of this publication may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying, recording, or any information storage and retrieval system, without permission in writing from the publisher. Details on how to seek permission, further information about the Publisher’s permissions policies and our arrangements with organizations such as the Copyright Clearance Center and the Copyright Licensing Agency, can be found at our website: www.elsevier.com/permissions.

    This book and the individual contributions contained in it are protected under copyright by the Publisher (other than as may be noted herein).

    Notices

    Knowledge and best practice in this field are constantly changing. As new research and experience broaden our understanding, changes in research methods, professional practices, or medical treatment may become necessary.

    Practitioners and researchers must always rely on their own experience and knowledge in evaluating and using any information, methods, compounds, or experiments described herein. In using such information or methods they should be mindful of their own safety and the safety of others, including parties for whom they have a professional responsibility.

    To the fullest extent of the law, neither the Publisher nor the authors, contributors, or editors, assume any liability for any injury and/or damage to persons or property as a matter of products liability, negligence or otherwise, or from any use or operation of any methods, products, instructions, or ideas contained in the material herein.

    Library of Congress Cataloging-in-Publication Data

    A catalog record for this book is available from the Library of Congress

    British Library Cataloguing-in-Publication Data

    A catalogue record for this book is available from the British Library

    ISBN: 978-0-12-823768-7

    For information on all Academic Press publications visit our website at https://www.elsevier.com/books-and-journals

    Publisher: Candice Janco

    Acquisitions Editor: Marisa LaFleur

    Editorial Project Manager: Emily Thomson

    Production Project Manager: Prem Kumar Kaliamoorthi

    Cover Designer: Matthew Limbert

    Typeset by TNQ Technologies

    J. Andrew Royle was the principal author of chapters 2 and 7. Use of product names does not constitute endorsement by the U.S. Government.

    Dedication

    For Jim Nichols, who changed the way in which we think about Ecology

    Foreword

    Observational or measurement error refers to the difference between a measured value of a quantity and the true value. Such error has long been known to statisticians and can often be treated as a normally distributed random variable with mean 0. However, in population and community ecology, focal quantities such as abundance and species richness typically are based on counts that are nearly always smaller than the quantities we seek to estimate; i.e., we always miss individual animals and plants in our counts. Treatment of this sort of measurement error, nondetection, requires a different kind of model for the process generating the counts. Wildlife and animal ecologists and their statistician colleagues recognized this error as an important issue and developed Binomial and other sampling models to compute approximately unbiased estimates of quantities such as abundance, density, and species richness using counts of animals detected. Substantial development of these models occurred during the latter half of the 20th century.

    This historical focus on sampling process by scientists in wildlife and animal ecology was both appropriate and important, but it came at a cost to scientific inquiry. Had ecologists been able to estimate focal quantities such as abundance directly by simple counts, they would have likely moved immediately to interesting questions about why these quantities varied from one place to another. Instead, the early models for estimation of static quantities (e.g., closed capture-recapture models, distance sampling, double-observer models) were tailored to single study sites and thus focused almost exclusively on sampling processes, ignoring the ecological processes underlying spatial variation in abundance and density. Hierarchical models were not used for investigations of such static quantities. Instead, these quantities were estimated, and estimates were then used in additional analyses to investigate hypotheses regarding their variation.

    At the turn of the century, ecologists began to consider occupancy models for species occurrence based on sampling across multiple sample units. Initial efforts used a clumsy, two-step approach based on closed capture-recapture thinking, but Andy Royle introduced an occupancy parameter directly into the likelihood (MacKenzie et al., 2002), thus developing a hierarchical modeling approach that opened the door to direct modeling of spatial variation in occupancy. Andy then considered this same type of design for abundance modeling via his N-mixture approach (Royle, 2004a,b, Kéry and Royle, 2010). In Volume 1 of Applied Hierarchical Modeling in Ecology (AHM1), Marc Kéry and Andy emphasized such metapopulation designs, and these two canonical hierarchical models developed for their analysis, occupancy and N-mixture models. Instead of conditioning on an unknown, but fixed, occupancy or abundance at a single location, they added a model component dealing with variation among sample units, as well as a component dealing with sampling process. This emphasis on both ecological and sampling processes remedied a major shortcoming of static inference for closed populations during the 20th century, an emphasis on sampling process to the near-exclusion of spatial, ecological process. In AHM1, Marc and Andy reminded us why we seek estimates of abundance, density, and species occurrence and richness in the first place—to investigate ecological hypotheses about variation in these quantities from one place to another.

    One important class of hypotheses about spatial variation in static quantities such as abundance, density, and species richness concerns the dynamic processes that generated the spatial patterns. The methods of AHM1 permit strong inference about the patterns themselves and the relevance of ecological covariates, thus providing some basis for inference about underlying dynamic processes. However, an omnipresent problem with trying to deduce process from pattern is that many different processes can give rise to any specified pattern. In recognition of this difficulty, Marc and Andy develop and present the dynamic models of AHM2 as approaches to observe and model dynamic processes directly.

    In contrast to the scarcity of hierarchical modeling of closed ecological systems in 20th century ecology, early (beginning in the mid-1960s) inference models of population dynamics were hierarchical, although this may not be widely appreciated, as they were typically written in a nonhierarchical way (AHM2). These models included parameters and model components for both the observation process and the dynamic ecological process underlying system dynamics. The focus of early capture–recapture and band recovery models was on survival rate, one of the vital rates responsible for population change. Covariates associated with temporal variation in survival were investigated initially using a two-step approach and eventually within single model structures. This process modeling was extended to deal with variation among groups of animals, where groups were typically small in number and could represent different locations, sexes, species, etc. AHM2 extends hierarchical survival modeling to metapopulation and metacommunity designs and the general case of many groups (e.g., sites, species), with group-specific parameters viewed as random effects governed by hyperparameters of a specified distribution. The dynamic models of AHM2 include metapopulation and metacommunity models for the occupancy state variable as well, where the vital rates are local probabilities of extinction and colonization.

    The point of this brief review is to emphasize that a major contribution of AHM1&2 is provision of a model framework that accommodates two kinds of models: (1) those expressing ecologically interesting hypotheses about variation in focal quantities and, conditional on these focal quantities, (2) those reflecting hypotheses about the sampling processes that generated the data. Historical focus on only (1) or (2), to the exclusion of the other, has been detrimental to the conduct of ecological science. The hierarchical framework gives us the best possible chance of developing reliable inferences.

    Another major contribution of AHM1&2 is an emphasis on the unifying structure provided by hierarchical models. Biologists during the 1970s and 1980s had access to a number of seemingly disparate methods for estimating quantities such as abundance, for example, closed and open capture-recapture models, distance sampling, double-observer sampling, removal sampling, etc. These approaches typically were viewed as unrelated recipes with no single conceptual underpinning. In the 1990s, biologists noted that these abundance estimators could be viewed within the common framework of a count statistic divided by an estimated detection probability for that statistic, providing some level of conceptual unification. However, there existed no unifying theme underlying the different recipes for estimating detection. AHM1&2 provide this additional unification by noting that the observation process underlying these different methods can be viewed using Binomial (repeat sampling) or multinomial (capture-recapture, distance sampling using discrete distance intervals, double-observer sampling, removal sampling) N-mixture models. In both sampling and ecological process modeling, the ability to treat parameters for large numbers of time periods, locations, and species as random effects from distributions defined by hyperparameters represents a unification as well.

    The importance of such conceptual unification cannot be overstated, I believe. Marc and Andy observed that AHM1&2 can be viewed as a set of books or monographs, but rather than publish them as separate entities, they instead chose to tie the methods together in these volumes. Their motivation was not intellectual satisfaction, but rather the increased understanding that arises from perceiving model similarities and underlying conceptual threads. Such understanding is very useful in properly selecting and using existing models, as well as in developing new models for different sampling methods and ecological hypotheses.

    In addition to these very general contributions, AHM1&2 provides the first monographic or book treatment of certain modeling approaches that have been developed relatively recently. For example, the Binomial N-mixture model of Royle (2004a) permits abundance estimation using a sampling process model that derives information from repeat visits to multiple sites. Inferring consequences of model assumption violations using simulation, selecting models, assessing fit, and deciding when to use Poisson versus other (e.g., negative Binomial) abundance distributions for inference are AHM1 discussion topics that will be very useful to practitioners. Extension of the N-mixture approach to deal with population dynamics yields multiple models for count data that represent recent developments. Most modeling of animal population dynamics prior to the last decade was based on marked individuals, whereas the fully dynamic model of Dail and Madsen (2011), and associated extensions, permit inference about survival and recruitment from repeat counts of unmarked individuals. The reduced sampling and data requirements of these count-based approaches, relative to many other sampling methods, have generated substantial interest among practitioners. The discussion in AHM1&2 appropriately acknowledges costs of these approaches in terms of increased difficulties in fitting models and increased, and sometimes substantial, sensitivity of parameter estimates to deviations in model assumptions.

    Integrated models represent another topic that is currently receiving substantial attention. Integrated models are developed to accommodate multiple data sources that are relevant to the same inference problem(s) and that can be written as joint likelihoods containing at least one shared parameter from either process or sampling model components, or both. Their motivation is increased precision of parameter estimates and, sometimes, the ability to estimate parameters that would not otherwise be identifiable. Citizen science data are often of lower resolution than data from designed studies carried out by trained biologists, and integrated models offer the possibility of using both data types together. My own limited experience with integrated models suggests that even a small amount of information from a high-resolution data source can go a long way toward resolving identifiability and robustness issues associated with models required by low-resolution data.

    The final major heading of AHM2, Advanced Models, includes not only the chapter on integrated models but also two chapters focusing primarily on occupancy, multistate models and false positives. The latter topic will become increasingly important as we increase reliance on citizen scientists and automated remote detection devices to collect data. The chapter on species interactions focuses on inference for the general situation that includes two classical topics of investigation in ecology, predator-prey interactions and competition. The chapter on spatial models deals with spatial covariation among sites that can compromise inference efforts that ignore it and, more importantly, that reflects the ecological processes underlying metapopulation and metacommunity dynamics. The chapter on spatial distance sampling includes the novel idea of using detection frequencies within pixels to develop density surface models with data collected along transects.

    Finally, AHM1&2 are filled with interesting suggestions and opinions that practitioners will find extremely useful. The volumes contain numerous ideas and tricks that are invaluable for both simulating data-generating processes and fitting models to data. Similarly, the volumes contain several useful approaches to selecting an appropriate model and assessing model fit. I appreciated a recommendation against blind adherence to model selection statistics, such as AIC, in cases where the low-AIC model does not produce sensible estimates. I also agree with the suggestion that sometimes it may be better to rely on estimates based on trusted models for high-resolution data than to automatically develop an integrated model to make use of lower-resolution data, especially when the added model components are complex and known to provide nonrobust estimates. AHM1&2 contain dozens of neat ideas for useful extensions of existing models and new modeling approaches that should be developed.

    As one who has tried to keep up with the development of ecological inference methods over the last half-century, I am extremely impressed by the deep understanding required to develop AHM1&2. Marc and Andy have not only been responsible themselves for many important new model developments and applications, but they also possess a thorough understanding of past efforts, allowing them to place prior work within their unifying hierarchical framework and extend it to develop new approaches. Such mastery of a bewildering array of ecological sampling methods and associated models is remarkable and largely responsible for the clarity of AHM1&2.

    Ecology is a science in which strong inferences are often difficult to obtain. The problems arise from several sources including the spatial and temporal scales at which processes must be studied, the difficulty of conducting true manipulative experiments in otherwise natural systems at these scales, and the substantial measurement error associated with most ecological sampling methods. AHM1&2 make an important addition to the ecologist's methodological toolbox, providing innovative ways to draw inferences from a variety of field sampling methods even at relatively large spatial scales. Thanks Marc and Andy for developing, reviewing and explaining these inference methods and for making them so accessible, hence giving us the best possible chance to make progress and conduct useful ecological science.

    James D. Nichols

    Crofton, MD USA

    July 19, 2019

    Preface

    This book is what we had originally thought would be the second half of one big, applied book on hierarchical modeling for ecology and related sciences. Now, it has become the big volume 2 of Applied Hierarchical Modeling for Ecologists or what we call AHM2 (Kéry and Royle, 2021), as opposed to AHM1, which is what we call Kéry and Royle (2016).

    Here is a brief summary of what you find in Volume 1 (AHM1). In its first part, we lay out the basics about the conceptual relationships between point, abundance and distribution patterns, the relationships between the latent (underlying, true) and the observed versions of these quantities, and the almost universal need to estimate rates of the associated observation errors. Then, we introduce hierarchical modeling and some of the fundamental statistical and computational know-how that you need to build your own custom hierarchical models. This includes an entire chapter about the simulation of data sets, which we consider a pivotal activity for any quantitative scientist. In the second part of AHM1, we provide six monographs on several classes of static (that is, closed-population) models for abundance, occurrence (distribution), and communities. These models cover a wide variety of sampling protocols, including: replicated point counts for Binomial N-mixture models, counts with individual identification leading to capture-recapture data and to Multinomial N-mixture models, two chapters on distance sampling, one on occupancy models for single species, and a final chapter on abundance- or occurrence-based models for (meta)communities.

    Volume 2 (AHM2) continues where AHM1 has left off. It is another Book of Monographs. In its first part, we collect five monographs on dynamic, or open-population, variants of the models covered in AHM1, except for distance sampling, for which we covered open models in AHM1 already, but with the addition of models for survival. In the second part of AHM2, we offer six monographs that deal with three important extensions to occupancy models, basic spatial models, integrated models, and distance sampling along transects and density surface modeling (DSM). Thus, AHM2 is a seamless sequel to AHM1 and builds on it, but at the same time AHM2 is a stand-alone book. We expect that anybody with a decent grasp of the required ecological, statistical and computational bases should be able to jump right in with any chapter, learn about a certain class of model and then apply it to his or her data set.

    In the remainder, we make some comments on the general concepts, principles, and the format of both AHM books. We covered part of this in detail in the Preface to AHM1 already, but repeat some of it for completeness here and add to what we said there. We will comment on the following topics:

    • Unifying themes of the AHM books

    • The experimental approach to statistical analysis

    • Unified format/layout of presentation

    • Intended audience

    • Computation

    • Book website and user group emails

    • Additional resources

    Unifying Themes of Both AHM Books

    In AHM1 (pages xvi–xix), we have explained in detail seven unifying themes that we emphasized throughout that book and which are pervasive also in AHM2:

    (1) Hierarchical modeling

    (2) Data simulation

    (3) Measurement error models

    (4) Dual inference paradigm approach (Bayesian and likelihood inference)

    (5) Accessible and gentle style, incl. hierarchical likelihood construction and data simulation

    (6) Cookbook recipes

    (7) Predictions

    One, we advocate hierarchical modeling as a unifying concept and overarching principle in modeling. Hierarchical models have many advantages, e.g., they can make the fitting of complex models easier (especially when using MCMC techniques); they naturally accommodate multiple sources of variation and uncertainty and hence are ideally suited to provide honest assessments of all the uncertainty around parameter estimates and model predictions. But to us, perhaps the most crucial and important benefit of hierarchical models, and especially of the process of building them, is that they naturally lead to what we believe is a much more scientific approach to statistical modeling, or to science-based statistical models. In a hierarchical model, we decompose the description of a big, complex stochastic system into a linked sequence of smaller probabilistic parts. That is, we represent a large joint probability density as a factorization of several conditional probability densities, each of which is simpler and more tractable both conceptually and computationally than the big joint density. Many different factorizations are possible for any given joint density, but we find that the requirement when specifying a hierarchical model to envision linked processes is a strong incentive to think about a scientific problem in a much more mechanistic way. That is, asking oneself "What are the different processes that combine to produce my data set?" and then representing these processes in the model. We find that this approach naturally leads to much clearer thinking about a problem in science or management.

    Two, throughout the book, we work a lot with simulated data sets. This emphasis on data simulation is a hallmark of both AHM books (and also of Kéry, 2010, and Kéry and Schaub, 2012). In AHM1, we have an entire chapter on data simulation. Here is a short list with reasons for why one should do plenty of data simulation in quantitative research.

    1. Truth is known: You know what your estimates should look like and can validate your code, be it home-grown MCMC, BUGS, or any other software.

    2. Observe sampling error: Sampling error is one of the hardest statistical concepts to grasp for ecologists. But when you have code to simulate a data set you can simply execute it multiple times and thus observe sampling error! That is, how features of the data set differ between one realization of the represented stochastic process and the next. Thus, data simulation is an invaluable statistical learning tool.

    3. Assess the frequentist operating characteristics of estimators: Repeatedly simulating a data set and then analyzing it using some model or statistical procedure allows you to assess the method, e.g., in terms of bias, precision, or confidence interval coverage. This provides another great learning experience for these key statistical concepts. At the same time, it is also important practically, e.g., to check at which point a data set becomes too small for an estimation procedure and the procedure breaks down in the sense that bias or imprecision become too big so that results may no longer be practically useable.

    4. Power analysis: Data simulation is the natural and most flexible approach to determining the power of a study, i.e., the probability with which a true effect can be detected, and to the related question about the required minimal sample sizes to obtain meaningful results in a study.

    5. Parameter identifiability: This is a huge, and underappreciated, topic in modern applied statistics. Especially in Bayesian analyses and especially with super-flexible software like JAGS, where we almost always get some numbers out in an analysis and where it may be easy to specify a model that has more parameters than what we can actually estimate from a given data set. Repeatedly simulating and analyzing data sets with varying parameter values and observing whether the estimates cluster around the known input values (= The Truth) is the single most powerful applied method to ascertain parameter identifiability for the types of models in the AHM books.

    6. Check the robustness of estimators and effects of assumption violations: These are two additional important topics where the use of replicated, simulated data sets is crucial.

    7. Data simulation provides proof that you understand a model: Perhaps this is the greatest benefit of all. We claim that if you understand a parametric statistical model, then you can simulate data under that model. And if you don't, then probably you haven't understood your model; it's as simple as that. Data simulation and analysis are two complementary activities that go in opposite directions: in data simulation, we choose some values for parameters and combine them with covariates to assemble some observed response, while in data analysis, we take the response and disassemble it to obtain estimates of these same parameters. See also the reverse motor-cycle analogy on p. 125 in AHM1.

    Indeed, we might add another point, which is this:

    8. Data simulation is an incredibly powerful way of explaining a statistical model: In fact, throughout both AHM books, we use the simulation of data sets as a teaching tool to explain a statistical model! We believe that for any scientist who is not trained in linear algebra and calculus, or only minimally so, there is hardly a more effective way of explaining what a certain statistical model is than inspecting R code that simulates a data set under that model.

    To us, simulating data sets and then analyzing them is a completely natural and integral part of the workflow of almost any bigger statistical analysis. Hence, we work a lot with simulated data sets throughout the book. In addition, we provide many data simulation functions for specific sampling protocols or models. These are handy to achieve many of the advantages of data simulation, although the most powerful advantage (points 7 and 8 in the above list) is lost. Therefore, in the cases when we do not also provide other code for data simulation (i.e., not packaged as a function), you may want to go into the function definition and dissect it into its pieces, and to execute its contents line by line, so that you can fully understand what the model means that is implied by that data simulation function.

    Third in our list of unifying themes, we think that the first candidate for a statistical model for abundance, distribution or related quantities for real ecological field data should always be a model with an explicit representation of the two main types of measurement error that afflict all such data: false negatives and false positives. Hence, a dominant feature of virtually all models in the AHM books is that they contain a meaningful description of one or both of these error processes in the form of a measurement error model.

    Four, to us the most sensible practical approach to statistical modeling is what might be called dual inference paradigm approach (or pragmatic Bayesian): choose Bayesian or likelihood inference depending on the type of data set, inference question, model, your level of statistical and computational knowledge, and also on the available computing resources. We make extensive use of the R package unmarked, which does likelihood inference for many of the types of hierarchical models covered in the two AHM books, and JAGS and WinBUGS, which do Bayesian posterior inference for all these models (or indeed, almost any type of statistical model).

    Five, although both AHM books are textbooks in statistical ecology, they differ from most other statistical textbooks in their accessible and gentle style. No doubt we have been influenced a lot by two landmark publications in the field of statistical textbooks for ecologists: the old Glim for Ecologists book by Michael Crawley from back in 1993 (now superseded by his books on R) and the hugely influential and widely used Gentle Introduction to Program MARK by Evan Cooch and an increasing list of coauthors (see www.phidot.org/software/mark/docs/book). Both of these books contain many richly commented cookbook-type of analyses, but they are mathematically perfectly rigorous and sound. We think that they have created a new teaching style paradigm for statistical textbooks geared toward nonstatisticians.

    When teaching hierarchical models to a nonstatistician audience, the hierarchical likelihood construction is eminently important. That is, as a sequence of linked probability statements rather than as one big, ugly, marginal likelihood, as you would typically see a model described in a paper in Biometrics or in countless more traditional statistics textbooks. In fact, in the AHM books, we usually describe the likelihood of a model in such a hierarchical manner three times: first, when we use algebra to describe a model; next, when we provide R code to simulate a data set under the model; and finally, when we use the BUGS language to specify the hierarchical model and fit it in JAGS. In all three, we define the likelihood in a sequential, or hierarchical, manner, and we believe that this is crucial in order that nonstatisticians can better understand these models, or understand them at all.

    Incidentally, we consider our use of BUGS software to be another major reason for why the AHM books are so gentle and accessible also to nonstatisticians. Since the 1990s, the BUGS language (Gilks et al., 1994; Lunn et al., 2000, 2009, 2013), which is adopted by WinBUGS, OpenBUGS, JAGS, and Nimble, has proven to be superbly understandable to thousands of researchers and students all over the world. Indeed, we like to think of the BUGS language as a sort of lingua franca for describing hierarchical models, for which it could become what the Wilkinson-Rogers (1973) scheme has become for the description of linear models (that's what comes after the twiddle when you do something like lm(y ∼ A ∗ x) in R).

    Six, we are big believers in the power of providing fully functional and richly commented "cookbook recipes" as a way of empowering nonstatisticians to understand and fit a certain type of model. It seems to us that cookbook recipes are sometimes frowned upon by statisticians, because these latter may fear that this approach to teaching will encourage people to do things that they don't understand and therefore to misuse of statistical methodology. We acknowledge that there may be that risk sometimes, but on the whole, we don't think it is a very big risk. On the other hand, there is a converse risk: that by not providing the full recipe for the analysis of a model, someone who does understand a model may still not be able to use it and then may use an inadequate model instead. Often only a fully running example analysis will really permit a nonstatistician to avoid the myriad of small pitfalls that may all prevent him or her to successfully fit a model to his data set, even if the ecologist has a decent grasp of the model and is therefore unlikely to misuse it.

    For an example, just think of the R code needed to organize a data set into a 3D or 4D array, which is needed for some community models (e.g., in Chapter 11 in AHM1 or in Chapter 5 in AHM2). Quite likely, many people will understand the basic concepts of these models, but not be sufficiently good R programmers to be able to organize their data set as required. And of course, any person fitting a model will want to adapt the cookbook recipe to his or her particular data set. This will require an understanding of the model, as will the description of model and results in a scientific paper or report. All of this will combine to weed out most of the potential misuse that may become possible when cookbook recipes are provided. In addition, cookbook recipes are also crucial for the experimental approach to applied statistics that we advocate, see below.

    Finally, seven, we emphasize predictions made with the fitted models, i.e., computation of the expected values, along with the uncertainty around them, of quantities such as the response or of some parameter, typically as some covariate is varied. Predictions are crucial to understand your model and to communicate the results from an analysis. In geographic space, plots of predictions are called a map and are a particularly popular, and often useful, form of prediction. For instance, map-making is almost a defining feature of a species distribution modeling (SDM) study. Forming predictions is sometimes challenging to ecologists. Hence, we provide numerous examples of all kinds of predictions made from the models that we fit.

    The Experimental Approach to Statistical Analysis

    In our own work, and in this book, an experimental approach to statistical analysis is very prominent, which means a tight interplay between data simulation and data analysis. This is one of the key things we want to teach with this book: try things out with simulated data! There is so much that you can and should be learning by analyzing simulated data sets. We have without a doubt simulated and analyzed hundreds of thousands of data sets and find it almost impossible to see how one can learn statistics without such an experimental approach to it.

    However, there is a sense in which the AHM books aren't real cookbooks, because only exceedingly rarely will you be able to directly take some code and apply it to your data set as is. Rather, our cookbook recipe should serve as a kick-start for your simulation-based explorations of the model that you intend to apply to your data set. Unless you know a model of interest really well, we would strongly encourage you to explore it, and its implementation using likelihood or Bayesian inference, by simulating a couple of dozen data sets with varying sample sizes and parameter values and then fitting the model. This doesn't need to be a formal simulation study: you can learn a lot already by just looking at a small handful of model fits and comparing them to the input values used to simulate these data sets.

    In addition, the experimental approach to statistical analysis can be invaluable for study design and study planning, i.e., before any data are collected. We think that virtually all graduate students in the applied sciences would benefit greatly if instead of beginning their foray into their research by wrestling exclusively with abstract and theoretical questions they are first confronted with the basic problem of how to simulate data from the field study that they intend to develop. Being able to do this is, in a sense, a forecast of what is to come and quite often can provide significant guidance on study design and implementation and, especially, the analysis approach used.

    Of course, nothing in this peroration is really novel: statisticians and also some ecologists have been doing this for many decades. But we just emphasize it very strongly, because we think it is one of the most rewarding and efficient approaches to learning in statistics. Especially for nonstatisticians, for whom this approach may mitigate to some degree the challenges they face at obtaining a more formal understanding of the mathematics underpinning a model. With present-day software such as R, it is unbelievably easy to do such simulations and adopt an experimental approach to statistics by exploring a model of interest to you. So just do it!

    Unified Format/Layout of Presentation

    For each monograph (= chapter) in this book, we describe a model class in principle, usually in words, but also with a hierarchical construction of the likelihood, i.e., as a linked sequence of probability statements in algebra. This leads directly to the implementation of the model in the BUGS language, because in this language hierarchical models are described in the very same manner. We then normally start by fitting simple models to simulated data, and progressively add in more complexity, to illustrate a whole range of applications for each model. In most chapters, we also present some real-world case studies, which add more realism and often also allow us to illustrate additional features of a model. As just discussed, throughout the book, we work a lot with simulated data sets, because there are so many advantages of assembling and then analyzing synthetic data sets.

    When launching JAGS, we typically provide approximate run times (ARTs). These are indicative only, but should help decide when to go and get a coffee, to stop your work for the night or to take a break and go on vacation.

    There is a lot of code in this book. Too much of it, some people will (rightly) say. But this is a choice that we made by consideration of the need for complete cookbook recipes so that most nonstatisticians can understand a model and also by our desire to make available much of the key code in the book, and not only on some website. However, we hope that our consistent layout of all analyses makes it possible for you to quickly navigate through the book in spite of this wealth of code. Of course, you can skip over things that don't interest you or that you don't need. On the other hand, don't skip the BUGS code too often, because it is an extremely useful, accessible, and concise description of any hierarchical model.

    In order to save space, we relegated much additional code to the website (see Book web pages below), especially much code for producing figures or other things that are not directly related to model fitting. In addition, we only show the key pieces of the BUGS code for some models, when we have already shown a variant of the same model in full. You can go to our book website to find the complete code for anything that we show in the book. That is, to run every analysis and to produce all figures that we show. In addition, we refer you to Mike Meredith's Github site for versions of all data simulation functions that are richly commented, unlike the functions in the AHMbook package on CRAN, where all comments are stripped according to the rules of R. Seeing the function code with all comments is of course a great help to understanding what the code does.

    Finally, we emphasize that not all output produced by some R function calls is printed out in the book. That is, very often we print some R code in the book, but don’t show the output it produces, in order to save space. Sometimes we then have a comment on the side: # output not shown ... while often we have not, and this is then implicit in a sense. A good example for this is that we always show a line of R code to print out the posterior summaries of the fitted model object returned by running JAGS using the jagsUI R package. We do this for the sake of completeness and consistency of the layout of the basic analysis of the model: it is important to us to show the complete workflow of an analysis. For instance, we may have this code line in the book:

    summary(umf <-- unmarkedFrameGMM(y = Ystacked, siteCovs = sc,

    numPrimary = 1, obsToY = o2y, piFun = crPiFun))

    But then we don’t show the full result this produces, i.e., we don't print the summary of the umf object in the book. This should simplify things for you, since when you execute this code, you directly get the data frame for unmarked and you also get a summary of it, which is practical to get an overview of the data you fit models to. Clearly, it would be best if you could read the book while sitting in front of your computer and executing all code (though perhaps with much reduced MCMC settings at first). And whenever you start working at an R session by following some of our code, please don't forget to load the AHMbook and the jagsUI R packages.

    Intended Audience of the Book

    The intended audience for most of AHM2 is essentially the same as that for AHM1 and we quote from there (p. xxi): "This book has two target audiences: first, ecologists and scientists and managers in related disciplines, where the demographic analysis of populations, meta-populations, communities, and metacommunities is a focus of interest. And second, statisticians, especially those hitherto unacquainted with these classes of hierarchical models, which are hardly ever taught in standard methodology classes or in typical classical applied statistics texts. For the former group, the book represents a practical how-to guide for each class of models and thus should be accessible to anyone with basic R programming knowledge."

    In addition, we hope that the books can serve as the basis for a graduate level class in ecology or natural resources on Statistical modeling in ecology or perhaps in Applied Bayesian analysis. It seems to continue to be the case that almost no university curriculum offers ecologists the tools that they definitely need and want to use for their actual research, such as many of the models covered in AHM1 and AHM2, hence the fairly high demand that we experience for workshops on these topics. In the applied sciences, universities continue to teach hypothesis testing, finite population sampling, experimental design, multivariate analysis, nonparametric statistics, and a host of other more or less archaic topics that came of age in the 1970s and 1980s. These may have a place in the education of applied scientists, but what they need most for their actual research is applied modeling. We know of only a handful of university programs that offer at least one solid class on applied modeling for ecologists. There should be more of these, and we hope the AHMs help in that regard.

    Computation

    We use R (R Core Team, 2018) and BUGS software, specifically JAGS (Plummer, 2003), but add in an inkling of models fit in WinBUGS (Lunn et al., 2000, 2009, 2013), because JAGS doesn't have inbuilt functions to deal with spatial autocorrelation. One reason for this choice is that currently R and BUGS are the de facto industry standard in ecology for general scientific computation and for applied Bayesian analyses, respectively. Another reason is that we have used them in our own work for many years, and this is perhaps the main reason for why we don't (yet) give Nimble (de Valpine et al., 2017) the place it may deserve in current applied Bayesian analyses. One final and essential reason for our choice of BUGS software for all our Bayesian computation is that BUGS can do discrete random effects directly, i.e., these need not be removed from the likelihood by marginalization (Yackulic et al. 2020). This is the main reason for why we have never used Stan (Carpenter et al., 2017), which appears to be an excellent software package, but requires the user to express the marginal likelihood explicitly (Joseph 2020b). Therefore, the likelihood can no longer be specified in a fully hierarchical manner. In our experience, this means that the vast majority of those ecologists who now can do wonderful things with the types of models we present in JAGS would be completely lost if they had to specify the same model in Stan.

    Regardless of the software you use, we think that one important point is this: BUGS code is really easy to read and the BUGS language offers a very general framework to describe almost any type of hierarchical model. So perhaps you are well-enough trained to fit hierarchical models in some other software, which may be less accessible to most ecologists, but perhaps be more powerful than JAGS, e.g., greta (Golding, 2018), Stan, or TMB (Kristensen et al., 2016) or you may write your own MCMC algorithms (Hooten and Hefley, 2019). In all of these cases, we think that the AHM books will still be useful for you: you can simply take the models and rewrite them in your own favorite language or code.

    We wrote this book using R 3.5 (with the exception of Chapter 8, for which we used R 3.6 with unmarked 0.13.1). As of R 3.6, there were some changes in the default random number generator (RNG) and so if you use a later version of R and want to reproduce our results in the book, you will need to specify the old RNG with RNGkind(sample.kind = Rounding) before generating the data. (In the proof stages of the book, we have added some code for this, but we may not have been entirely consistent.)

    Book Web Pages, R Package, and User Group Emails

    For both AHM books, we have two book web pages, which are similar, but one is more frequently updated. The main page is at Patuxent: www.hierarchicalmodels.com. A secondary book web page is here: sites.google.com/site/appliedhierarchicalmodeling/home. It contains a list of Errata for which we are glad to hear from you about new entries that are needed. The main book web page has the complete R and BUGS code, in addition to some bonus material, and this is also available at https://github.com/mikemeredith/AHM_code; the Github code will be updated to work with new releases of R and packages.

    Thanks to Mike Meredith, we have a real R package for the book on CRAN: AHMbook. Version 0.2.0 or later contains all data sets that we use in both books, all data simulation functions and a range of utility functions as well. All are decently documented in the help files. Install the current CRAN release with install.packages(AHMbook). In addition, you can find all the package code with explanatory comments on Mike's Github site at github.com/mikemeredith/AHMbook.

    There are two user group email lists that are of particular interest for readers of the AHM books, one for unmarked and the other for hierarchical models in general: groups.google.com/forum/#!forum/unmarked and groups.google.com/forum/#!forum/HMecology. There will be questions with some topical overlap between the two groups, but we encourage people to use the former only for questions which are directly related to something that you code up in unmarked or intend to do. In contrast, the HMecology list is intended for any general question about the types of hierarchical models covered in our books and implemented in BUGS software (i.e., about material covered in Royle and Dorazio 2008; Kéry, 2010; Kéry and Schaub, 2012, in addition to AHM1 and AHM2 and also for the upcoming new book on Integrated Population Models by Schaub and Kéry, 2021), though not on spatial capture-recapture (SCR, e.g., Royle et al., 2014) for which there is a third user group email list (groups.google.com/forum/#!forum/spatialcapturerecapture). Note that Nimble has its own active user group; see the main Nimble web page (r-nimble.org). We also note that of course you need a Google account to access the Google group email lists.

    Additional Resources

    We encourage you to explore Nimble for fitting the types of hierarchical models in our books and are very grateful to Perry de Valpine and his colleagues for having translated all the BUGS code in AHM1 into the Nimble dialect of the BUGS language, see github.com/nimble-dev/AHMnimble. This is an extremely valuable resource that should enable you to quickly get into the Nimble implementations of the types of models in the AHM books.

    Acknowledgments

    We owe more than we can say to our dear colleague Mike Meredith, who may rightly be considered as a shadow coauthor of this book. In many respects, Mike is a remarkable man, who has a fantastic grasp of all kinds of statistical concepts and models. More than once he has saved us from blunder. In addition, Mike is an excellent R programmer. He has checked all our code and provided a wealth of extremely valuable tips for making our code more concise, clear, or correct. And, we are especially grateful to Mike for putting together the R package that goes along with both AHM books and which is available on CRAN.

    We thank our esteemed colleague and scientific mentor, Jim Nichols, for writing a Foreword to our book and for being such an inspiration to a whole scientific field for almost half a century now.

    The following people have read parts of or whole chapters, given valuable comments, or discussed specific problems with us: Res Altwegg, Thierry Chambert, Richard Chandler, Courtney Davis, Pierre Defos du Rau, Bob Dorazio, Gonçalo Ferraz, Keiichi Fukaya, Jérôme Guélat, John-André Henden, Nathan Hostetter, Paige Howell, Francis Hui, Ken Kellner, Rassim Khelifa, Andrew MacLaren, Darryl MacKenzie, Mick McCarthy, David Miller, Jeremy Mizel, José Lahoz-Monfort, Byron Morgan, Chris Rota, Sarah Saunders, Michael ('Miguel') Schaub, Joshua Schmidt, Scott ('Scottus') Sillett, Nicolas Strebel, Cat Sun, Chris Sutherland, Mathias Tobler, Alex Wright, Yuichi Yamaura, Qing Zhao, Elise Zipkin, and Erin Zylstra.

    We offer our warm thanks to Ken Kellner and Mason Fidino who contributed major parts of the code to fit the multispecies occupancy model of Rota et al. (2016a) in unmarked and in JAGS in Section 8.2 and who both were generous with help in implementation and interpretation.

    We are indebted to Richard Chandler and Ian Fiske for creating unmarked. Most recently, Ken Kellner has made tremendous contributions to unmarked, leading to the release of version 1.0 just prior to the publication date of this book, and we are extremely grateful to him for this. Over the years, Marc Mazerolle's powerful R package AHMmodavg has developed into an invaluable companion to unmarked. We thank Marc for his interest in hierarchical modeling and for implementing important methods in his package. Ken Kellner's jagsUI package has been our R-to-JAGS interface of choice. Thank you, Ken, for always being quick and helpful in addressing our queries.

    We are very grateful to the people developing the Nimble software. Perry de Valpine and his colleagues have recognized the power of the BUGS language to give nonstatisticians full flexibility to define and fit hierarchical models, including hierarchical models with discrete random effects. They are building Nimble for maximum benefit for both nonstatisticians (by retaining the original BUGS language and by allowing discrete random effects) and for statisticians, by endowing their software with many advanced features and great extensibility.

    Our calls on the unmarked and HMecology Google group email lists for proof readers produced plenty of replies, and we thank the following people for their help: Jim Baldwin, Eduardo Carrillo-Rubio, Tadhg Carroll, John Clare, Jonathan Cohen, Rusby Guadalupe Contreras Díaz, Alexandra Curtis, Dilşad Dağtekin, Kadambari Devarajan, Gonçalo Ferraz, Frank Fogarty, Neil Gilbert, Fabiola Iannarilli, Jose Pepe Jimenez, Wendy Leuenberger, Dechen Lham, Dan Linden, Arnaud Lyet, Nicholas Masto, Adrian Monroe, Chloe Rebecca Nater, Steffen Oppel, Ben Padilla, Jennifer Lynn Price Tack, L. Jay Roberts, Rob Robinson, Susana Rostro García, Sarah Saunders, Benedikt Schmidt, Richard Schuster, Rahel Sollmann, Andrés Valenzuela Sánchez, and John Vanek.

    We are extremely indebted to the many individuals and organizations who freely shared their valuable data sets with us. We have acknowledged them in the book and in the help files for the data sets in the AHMbook package. We are also very grateful to the photographers who provided us with wonderful illustrations. We acknowledge them all in the figure legends.

    Special thanks by Marc:

    I thank my employers, the Swiss Ornithological Institute, for giving me much freedom to research what I thought was beautiful, interesting, and important, over so many years. Niklaus Zbinden and Thomas Sattler have always been very supportive of me and my research program. I thank all my Vogelwarte colleagues in the Monitoring department (A1) for the good companionship over the years and especially Hans Schmid for always being very helpful in getting me the data I needed, plus, for designing and running the MHB, my favourite Breeding Bird Survey in the world. Without the MHB this book would not look the way it does now and indeed may never even have been written in the first place. I would also like to thank my friend David Parish for being such a patient English conversation teacher for so many years.

    I thank USGS Patuxent Wildlife Research Center for hosting me as a postdoc in 2001–2003 and during numerous visits ever since. I often think that for me, it all began in Patuxent!

    I must ask for forgiveness from my family (Susana and Gabriel) for having had to put up with me while I suffered from excess work load during many months when we finished this book.

    Special thanks by Andy:

    I thank my children, Abby and Jake, for their good spirits and support during the final push of book writing.

    I thank USGS Patuxent Wildlife Research Center for providing an environment that fosters the development of research in statistical monitoring and assessment of wildlife populations. I especially thank Allan O'Connell who has been very supportive of me and my research program.

    Marc and Andy

    Pucallpa/Peru and Laurel/USA, July 18, 2019

    Introduction

    1. Spatiotemporal Hierarchical Models

    This is a book about spatiotemporal statistical models for the analysis of data from metapopulation designs using a specific type of hierarchical models. These models make a formal distinction between the true, latent, and the observed states of a quantity of interest, such as abundance or occurrence (Royle, 2004a,b; Royle and Dorazio, 2006, 2008). By metapopulation design, we mean spatial replication, and hence, that at some level in our models we can stratify by space, or sites (Kéry and Royle, 2010). The distinction between latent and observed state means that these models typically contain a component for imperfect detection and possibly also for false-positive detections. In volume 1 of the project (AHM1, Kéry and Royle, 2016), we covered closed-population models with just this spatial stratification. Here we extend this powerful inferential framework to the temporal dimension and develop spatiotemporal hierarchical models to describe changes in the modeled quantities over time.

    Key features of both spatial (i.e., static) and spatiotemporal (i.e., open or dynamic) hierarchical models in this book are as follows:

    • These hierarchical models have one level for the latent (i.e. un- or only partially observed) state of a site, such as abundance or occurrence, and another level for the observed data (and sometimes there may be additional levels). These two levels are connected by the observation model which corrects for observation error. Thus, these models contain a rigorous treatment of the measurement error which arguably always afflicts field data on populations and communities in ecology, wildlife management and related fields. Unaccounted measurement error has the potential to bias all your inferences about demographic quantities in populations and communities, such as abundance, occurrence, or species richness and composition.

    • As Jim Nichols points out in the Foreword, these hierarchical models thus embed a process model (e.g., describing the drivers of spatial or spatiotemporal variation in abundance, which may be your key interest) into a measurement error formulation for your observed data, which corrects your inferences for detection bias. Scientifically, the observation model is usually more of a nuisance, i.e., something that we must include in the model to get things right, and not something that we are really interested in. Thus, these models permit you to do all your science within your statistical model, but to do it within a framework that properly accounts for measurement error, all at once.

    • Most of the times, these hierarchical models are applied to data from unmarked individuals (hence the name of our favorite R package), but not always. For instance, Multinomial N-mixture models (Chapter 7 in AHM1) can be directly applied to spatially replicated capture-recapture data. A dynamic occupancy model with some restrictions on its parameters is one way to implement a classical statistical model for marked individuals: the Jolly-Seber model (Jolly, 1965; Seber, 1965; Chapter 10 in Royle and Dorazio, 2008 and also in Kéry and Schaub, 2012). Similarly, when using data augmentation we adopt what in essence is an occupancy model to estimate the size of a closed population based on traditional capture-recapture data (Royle et al., 2007a; also see Chapter 6 in Kéry and Schaub, 2012). Hence, while most models in this book and its prequel AHM1 are for data from unmarked individuals, the boundaries are often blurred between these models and typical capture-recapture models for data from marked individuals (Seber, 1982; Borchers et al., 2002; Williams et al., 2002). You can apply many of the models in AHM2 also to data from marked individuals, with little or no modification.

    The hierarchical models in this book have an extremely wide scope of application. On the one hand, they may be applied to collections of sites that are large and contain numerous individuals that cannot be individually identified or that might even be hard to count in principle. For instance, imagine the parasite load of an individual that is treated as an occupied site in such an analysis. On the other hand, these models may just as well be applied in the opposite case, when a site can only hold a single individual, a pair or a family group. The sole thing that changes will be the precise interpretation of the model's parameters.

    As a first illustration for the extreme versatility of the hierarchical models in this book we

    Enjoying the preview?
    Page 1 of 1