# Bayesian Hierarchical Models in Ecology

*2019-09-16*

# Chapter 1 Background

Welcome to *Bayesian Hierarchical Models in Ecology*. This is an ebook that is also serving as the course materials for a graduate class of the same name. There will be numerous and on-going changes to this book, so please check back. And don’t hesistate to email me if you have questions, comments, or for anything else.

To start, let’s calrify the title of this text—it should be *Hierarchical Models in Ecology Using Bayesian Inference*. A *Bayesian Hierarchical Model* is more a term of convenience than accuracy, as hierarchical models need not be Bayesian and Bayesian models can take many forms. However, hierarchical models and Bayesian inference do work together very nicely, as you will see, and so hopefully the title is not too misleading. I have dedicated several parts of this book attempting to differentiate these terms and concepts, while also making them as useful as possible.

## 1.1 How to Use This Book

You are welcome to use this book in any way you find it useful. The contents are really a mashup of conceptual descriptions, lecture notes, enumerated and itemized lists, images, code, analysis, models, output, plots, and other things that I wanted to include. The only real motivation behind the content and organization is that it has been useful for some students to learn, and so I have tried to adopt the best and most effective formats while revising others. `Bookdown`

has provided such freedom in creating content, and perhaps I have veered too far from traditional formats.

The document structure (e.g., chapters, sections, etc.) should be logical enough to skip around, if you prefer. I rely somewhat heavily on quotes and more heavily on code, which are formatted with thier own colored boxes.

Quotes are in colored boxes.

## 1.2 Acknowledgments

In creating this course and format, I want to first acknowledge Ty Wagner. In reality, Ty is the co-author of this text. Ty taught me most of what I know about Bayesian hierarchical models, and for a few years he and I taught a multiday Bayesian hierarchical models workshop from which much of these course materials derive. I would also like to thank Yihui Xie for all his work in developing numerous `R`

packages, especially the `bookdown`

package (Xie 2019) that has enabled the creation of this book.

## 1.3 Motivation

The computer scientist Alan Kay is known for this quote:

People who are really serious about software should make their own hardware. –Alan Kay, 1982

I have always liked this quote and have choosen to adapt it for how I think about data analysis. My adaptation of this quote also serves to describe why I have undertaken learning statistical models and the general approach I advocate for students and other data analysts.

People who are really serious about their analyses should code their own models. –Midway, 2018

### References

Xie, Yihui. 2019. *Bookdown: Authoring Books and Technical Documents with R Markdown*. https://CRAN.R-project.org/package=bookdown.