Abstract
 Top of page
 Abstract
 Introduction
 Scientific inference
 How do ecologists use Bayesian inference?
 A worked example
 The data: a latitudinal gradient of species richness
 Classical inference on the ant data
 Bayesian inference on the ant data
 Uncertainty in model selection
 The future of Bayesian ecology
 Acknowledgments
 References
Bayesian inference is an important statistical tool that is increasingly being used by ecologists. In a Bayesian analysis, information available before a study is conducted is summarized in a quantitative model or hypothesis: the prior probability distribution. Bayes’ Theorem uses the prior probability distribution and the likelihood of the data to generate a posterior probability distribution. Posterior probability distributions are an epistemological alternative to Pvalues and provide a direct measure of the degree of belief that can be placed on models, hypotheses, or parameter estimates. Moreover, Bayesian informationtheoretic methods provide robust measures of the probability of alternative models, and multiple models can be averaged into a single model that reflects uncertainty in model construction and selection. These methods are demonstrated through a simple worked example. Ecologists are using Bayesian inference in studies that range from predicting singlespecies population dynamics to understanding ecosystem processes. Not all ecologists, however, appreciate the philosophical underpinnings of Bayesian inference. In particular, Bayesians and frequentists differ in their definition of probability and in their treatment of model parameters as random variables or estimates of true values. These assumptions must be addressed explicitly before deciding whether or not to use Bayesian methods to analyse ecological data.
Introduction
 Top of page
 Abstract
 Introduction
 Scientific inference
 How do ecologists use Bayesian inference?
 A worked example
 The data: a latitudinal gradient of species richness
 Classical inference on the ant data
 Bayesian inference on the ant data
 Uncertainty in model selection
 The future of Bayesian ecology
 Acknowledgments
 References
Bayesian inference is an alternative method of statistical inference that is frequently being used to evaluate ecological models and hypotheses. Bayesian inference differs from classical, frequentist inference in four ways:
 1
Frequentist inference estimates the probability of the data having occurred given a particular hypothesis (P(YH)) whereas Bayesian inference provides a quantitative measure of the probability of a hypothesis being true in light of the available data (P(HY));
 2
Their definitions of probability differ: frequentist inference defines probability in terms of longrun (infinite) relative frequencies of events, whereas Bayesian inference defines probability as a individual's degree of belief in the likelihood of an event.
 3
Bayesian inference uses prior knowledge along with the sample data whereas frequentist inference uses only the sample data;
 4
Bayesian inference treats model parameters as random variables whereas frequentist inference considers them to be estimates of fixed, ‘true’ quantities.
The last three distinctions are epistemic, and one should consider them carefully in choosing whether to use Bayesian or frequentist methods.
This review has three parts. First, I summarize differences between Bayesian and frequentist methods of inference. This section provides the background necessary to decide whether to use Bayesian or frequentist methods. Second, I review briefly the range of ecological problems to which Bayesian inference has been applied. Third, I contrast frequentist and Bayesian inference in a simple ecological example, using generalized linear models to model species richness across a latitudinal gradient.
Scientific inference
 Top of page
 Abstract
 Introduction
 Scientific inference
 How do ecologists use Bayesian inference?
 A worked example
 The data: a latitudinal gradient of species richness
 Classical inference on the ant data
 Bayesian inference on the ant data
 Uncertainty in model selection
 The future of Bayesian ecology
 Acknowledgments
 References
We are all familiar with ‘the’ scientific method of testing statistical null hypotheses (Popper 1959). In brief, we ask what is the probability that we would have obtained our set of data (an independent, random sample of a larger population), or a more extreme set of data, if the null hypothesis was true. Generically, we write this as P(YH_{0}), where Y is the data and H_{0} is the null hypothesis.^{1} Technically, the hypothesis is a model with (known or unknown) parameters. For example, if we are interested in testing if species richness varies with latitude, we compute the probability of obtaining a set of sample data given the null hypothesis of a regression model in which the slope (or unknown parameter) β_{1} equals zero. Our data provide an estimate of the mean and variance of the parameter β_{1} in our sampled population, and we compute the probability of obtaining these estimates if β_{1} equals zero.
If this probability – called the Pvalue – is ‘small’, we reject the null hypothesis. How small a Pvalue must be for the null hypothesis to be rejected is a matter of convention: the standard cutoff value is the Neyman–Pearson acceptable probability of committing a TypeI statistical error: α = 0.05 (Hubbard & Byarri 2003). It bears repeating that this method of hypothesis testing allows only for falsification or rejection of hypotheses (Popper 1959). The common conclusion drawn from obtaining a small Pvalue that the alternative hypothesis is true with probability equal to (1−P) is incorrect.^{2} Similarly, a large Pvalue does not provide evidence in favour of the null hypothesis (Howson & Urbach 1993).
A prerequisite of this method – frequentist statistical inference – is a concept of probability defined as the relative frequency of a particular observation (an event or outcome). In other words, the probability P of an event A (written as P(A)) equals the number of times that event occurs (n_{A}) divided by the total number of observed events (n). As n is, in principle, infinite, the frequency definition of probability asserts that as n∞, n_{A}/n the true (population) value of P(A). Under standard design criteria (independent, identically distributed, random samples), the sample data provide unbiased estimates of P(A). The interpretation of a frequentist confidence interval follows directly from this definition of probability. A p% confidence interval calculated from the sample mean and variance asserts that in n hypothetical runs of an experiment, the parameter of interest (e.g. the true population mean μ) is expected to occur in the computed interval in p% of the experimental runs. Thus, in (1−p)% of the experimental runs, the computed interval will not include the true value of the parameter (illustrated clearly in the simulations of Blume & Royall 2003). Note that in any particular experiment, the parameter is either in the interval or not, but you never know which. It is incorrect to interpret a confidence interval by asserting that you are p% sure that the parameter of interest lies in the confidence interval.
Bayesian inference, in contrast, asks what is the probability of our hypothesis (again formulated as a model with known or unknown parameters) being true conditional on the sample data. This probability is found by applying Bayes’ Theorem (Bayes 1763):^{3}
 (1)
The quantity P(HY), or the probability of the hypothesis given the data, is called the posterior probability distribution, or simply the posterior. The quantity f(YH) is the likelihood (Edwards 1992).^{4} The quantity π(H) is called the prior probability distribution, or just the prior, and reflects information available about the hypothesis independent of (and hence prior to) conducting the experiment. The denominator P(Y) is simply a normalizing constant – the marginal probability density of the data across all possible hypotheses – and is equal to ∫_{H}f(YH)π(H) dH.
Bayesian inference is predicated on a different concept of probability: subjective probability or an individual's degree of belief that a particular event will occur (Howson & Urbach 1993; Barnett 1999). Estimates of degrees of belief may vary from individual to individual, but in all cases are conditional on past experience. Because Bayesian inference has been criticized for its subjectivity and reliance on personal belief, much effort has been dedicated to generating ‘objective’ measures of degrees of belief (Jeffreys 1961). Most recently, Berger (2003) has proposed a reconciliation of frequentist and Bayesian significance testing, but his approach has been criticized for failure to use the foundation of Bayesian inference: subjective probability (see published comments following Berger 2003). Software used for calculating posterior probability distributions using Bayes’ Theorem can accept either informative (‘subjective’) or noninformative (‘objective’) priors and the calculations proceed independent of one's definition of probability. The interpretation of the results, however, does require a definition of probability. A Bayesian posterior is an expression of a degree of belief whereas a frequentist Pvalue or confidence interval is an expectation of a longrun frequency. In contrast to a frequentist confidence interval, a Bayesian credibility interval is interpreted correctly as one's belief that there is a p% probability that the parameter of interest lies within the interval.
Bayesian and frequentist inference also differ in their use of prior knowledge. Frequentist testing of statistical null hypotheses assumes that there is no relevant information, such as other observations or experiments, available from past experiences. Computing a Pvalue is always a de novo exercise that begins with the null hypothesis, even if it has been falsified repeatedly in many previous studies. Frequentists view this lack of consideration of prior information positively, as it leads to an unbiased assessment of the sample data conditional on the hypothesis.
Bayesians counter that the traditional Pvalue actually is interpreted subjectively, even if the frequency definition of probability precludes such an interpretation. Further, there is no objective criterion for setting the critical level for rejection of an hypothesis (why not use 0.1 or 0.001 instead of 0.05), and the Pvalue is based not only on the sample data but also on more extreme data that is not and may never be observed (Jeffreys 1961; Berger & Berry 1988). We almost always have some reasons for conducting a particular experiment, developing a particular hypothesis, or using a particular model to analyse our data. Does it make sense to ignore available data or observations and jump off the shoulders of the giants that have worked before us? Efron (1978, 1986) and Dennis (1996, 2004) provide good overviews of the arguments for and against subjectivity and objectivity in Bayesian and frequentist inference; see Berger (2003) for an attempt at finding the middle ground.
Bayes’ Theorem is also iterative. An investigator may start with little or no information with which to construct the prior, but the posterior derived from the first experiment can then be used as a prior for the next experiment. The iterative nature of Bayesian inference is a central ingredient in the successful implementation of adaptive management (Walters & Holling 1990; Dorazio & Johnson 2003).
Lastly, Bayesian inference treats model parameters as random variables. Thus, not only are the data considered to be samples from a random variable, but also the parameters to be estimated are treated as random variables. This is a very different assumption from that of frequentist (and likelihood) inference, which treats parameters as true, fixed (if unknown) quantities (Fisher 1922; Edwards 1992). The studies by Strong et al. (1999) and de Valpine & Hastings (2002) are the only examples I have found where ecologists explicitly rejected a Bayesian method because it considered the parameters to be random variables and not a reflection of a fixed reality. In general, ecologists should consider carefully their epistemological stance when choosing among statistical methods.
How do ecologists use Bayesian inference?
 Top of page
 Abstract
 Introduction
 Scientific inference
 How do ecologists use Bayesian inference?
 A worked example
 The data: a latitudinal gradient of species richness
 Classical inference on the ant data
 Bayesian inference on the ant data
 Uncertainty in model selection
 The future of Bayesian ecology
 Acknowledgments
 References
Ecologists have long known of and used Bayes’ Theorem. Shortly after Pearson (1907) showed that an approximation of the hypergeometric series could be used to estimate posterior distributions for the condition of multiple events and full prior distributions, Pearl (1917) applied it to estimate the probable error of allelic frequencies in Mendelian populations (see also Karlin 1968; Pollak 1974). This method was elaborated in the 1970s and 1980s to determine the probability of paternity when multiple fertilizations are possible, such as in plants and fruit flies (Levine et al. 1980; Adams et al. 1992). It continues to be used in population genetic studies, including estimating the probability of introgression into wild populations of genes from genetically modified crops (Cummings et al. 2002).
Conditional probabilities calculated using Bayes’ Theorem also were used extensively in dynamic models of foraging behaviour (Oster & Heinrich 1976; Clark & Mangel 1984; Valone & Brown 1989) and predator avoidance (Anderson & Hodum 1993). These models explicitly considered that foraging animals used previous experience to modify future foraging activities and take full advantage of the iterative nature of Bayes’ Theorem. Although early work on socalled ‘Bayesian foragers’ used only the expected value (e.g. the mean) of the foragers’ probability distributions in their models, current Bayesian models of foraging behaviour use the full posterior probability distributions (Olsson & Holmgren 1999; van Gils et al. 2003).
The application of Bayesian inference to ecological questions has blossomed since the publication in 1996 of a series of papers on Bayesian inference for ecological research and environmental decision making (Dixon & Ellison 1996). Bayesian methods have been used most widely in population and community ecology (Table 1), in which there are many competing models to explain ecological phenomena (Hilborn & Mangel 1997), the parameter values of the models have high levels of uncertainty, and the reporting of this uncertainty (as standard errors or confidence intervals) is common. Bayesian inference is used extensively to model dynamics of single species, forecast population dispersal, growth, and extinction, and predict changes in metapopulation structure on fragmented landscapes (Table 1). Foraging dynamics and predator–prey interactions continue to benefit from Bayesian methods, but they are used rarely in studies of competition; there has been a parallel 20year decline in studies that estimate niche breadth and associated competition coefficients (Chase & Liebold 2003). Among community ecologists, Bayesian inference has been used most frequently for estimating species occurrences and species richness from geographically or logistically constrained samples, or in response to expected environmental change (He et al. 2003). A promising new avenue for research is the use of Bayesian methods to reconstruct palaeocommunity structure and to place estimates of uncertainty on those reconstructions (Toivonen et al. 2001; Platt et al. 2002). In marked contrast, ecosystem studies have applied Bayesian inference only rarely (but see Carpenter et al. 1996; Cottingham & Carpenter 1998).
Bayesian inference is central component of formal decision analysis (Berger 1985), and has been used to assess environmental impacts (Reckhow 1990), to decide among alternative management regimes (Raftery et al. 1995; Layton & Levine 2003), and to structure adaptive management programs (Dorazio & Johnson 2003). Nonetheless, despite its utility for expressing uncertainty of predictions made by conservation biologists (Wade 2001) and environmental managers (Ellison 1996), Bayesian methods have not been adopted broadly by these groups. I suspect this is due to computational difficulties, lack of userfriendly software, and the requirements for precise quantification of management options and their associated utilities or outcomes.
Classical inference on the ant data
 Top of page
 Abstract
 Introduction
 Scientific inference
 How do ecologists use Bayesian inference?
 A worked example
 The data: a latitudinal gradient of species richness
 Classical inference on the ant data
 Bayesian inference on the ant data
 Uncertainty in model selection
 The future of Bayesian ecology
 Acknowledgments
 References
I examined simple additive models (richness S as a function of habitat type, latitude, elevation) and models that included all possible interaction terms. The ‘best’ model was chosen from the set of candidate models by minimizing Aikaike's information criterion (AIC; Burnham & Anderson 2002):
 (2)
In eqn 2, is the likelihood of the model (which has parameters β) conditional on the data (see Footnote 4), and k is the number of parameters in the model. The model for which AIC was minimized was a simple additive model with an intercept (β_{0}) and all three main effects (β_{1}, β_{2}, β_{3}), but no interaction terms (Table 3):
 (3)
Table 3. Results of model selection for possible loglinear models relating species richness (S) to habitat type (H: forest or bog), latitude (L: decimal degrees), and elevation (E: metres above sea level) Model  AIC  DIC  p_{D} 


S = H  77.08  237.43  1.98 
S = L  83.97  243.29  1.48 
S = E  90.33  250.67  1.99 
S = H + L  56.29  216.32  2.81 
S = H + E  62.65  223.01  2.99 
S = L + E  76.37  236.61  2.83 
S = H + L + E  48.68  208.76  3.85 
S = H + L + E + H × E  50.27  210.17  4.75 
S = H + L + E + L × E  50.32  211.16  5.02 
S = H + L + E + H × L  50.64  210.39  4.29 
S = H + L + E + H × E + L × E  51.90  211.18  5.26 
S = H + L + E + H × E + H × L  52.26  210.98  4.86 
S = H + L + E + L × E + H × L  53.30  211.38  5.16 
S = H + L + E + H × E + L × E + H × L  53.90  217.18  7.93 
S = H + L + E + H × E + L × E + H × L + H × L × E  55.76  215.66  7.92 
The fit of this model to the data is illustrated in Fig. 1 (top). The maximum likelihood estimates of the parameters, their standard deviations, and 95% confidence intervals are presented in the first column of Table 4. The null hypothesis that β equals zero is rejected for each β_{i}.
Table 4. Parameter estimates for the additive model (eqn 3) predicting ant species richness from habitat, elevation, and latitude  Classical model (maximum likelihood estimate)  Bayesian models 

Posterior mode, noninformative prior  Posterior mode, informative prior  Averaged model, noninformative prior 


 11.95 (2.65) [6.81,17.73]  11.49 (1.87) [7.89, 15.32]  12.18 (2.22) [6.89, 16.33]  12.03 (2.65) 
 −0.24 (0.06) [−0.36, −0.11]  −0.23 (0.04) [−0.31, −0.14]  −0.24 (0.05) [−0.33, −0.12]  −0.24 (0.06) 
 −0.001 (0.0003) [−0.002, −0.0004]  −0.001 (0.0004) [−0.002, −0.0004]  −0.001 (0.0004) [−0.002, −0.0004]  −0.001 (0.0004) 
 0.64 (0.06) [0.44, 0.75]  0.64 (0.12) [0.40, 0.88]  0.63 (0.12) [0.40, 0.84]  0.64 (0.12) 
A key assumption of this model is that the observations are independent random samples, and in particular, that the forest and bog observations at a given site are independent of each other. This independence is observed in two ways. First, the deviance residuals are uncorrelated (Fig. 1b), which supports the statistical criterion for independence. Second, the bog and forest samples are biologically independent, as they are separated by hundreds of metres (far greater than the foraging distance of a single ant colony) and bog and forest ant assemblages share few species in common (Gotelli & Ellison 2002a,b).
From the frequentist analysis, the inferences are:
 1
The data are improbable given the null hypothesis that the parameters of the model (i.e. the regression coefficients β) equal zero. In other words, because P(dataH_{0}) < 0.05, the null hypothesis is rejected.
 2
The model fitting procedure provides maximum likelihood estimates of the parameters. We can use the standard errors of these estimates to construct confidence intervals on these parameters (
Table 4). The conclusion is that in repeated sampling (which is unlikely, as collecting this single sample required >3000 personhours), 95% of the time the true values of the parameters will fall within the estimated confidence intervals.
 3
The model fit is reasonable. A linear regression of the observed data on the predicted values illustrates that the model accounts for 55% of the variance in the data.
Bayesian inference on the ant data
 Top of page
 Abstract
 Introduction
 Scientific inference
 How do ecologists use Bayesian inference?
 A worked example
 The data: a latitudinal gradient of species richness
 Classical inference on the ant data
 Bayesian inference on the ant data
 Uncertainty in model selection
 The future of Bayesian ecology
 Acknowledgments
 References
Bayesian inference uses not only the sample data but also any available prior information. Using Bayes’ Theorem to calculate the posterior probability of the model conditional on the data requires explicit specification of the prior probability of the model – i.e. prior probability distributions for each of the model's parameters. Thus, we use eqn 1 to estimate the posterior:
 (4)
The term f(dataβ) in eqn 4 is the likelihood of the data (the same as in eqn 2). As in the classical model, the likelihood is modelled as a Poisson random variable. The term π(β) in eqn 4 is the prior. Many investigators choose to use noninformative normal (Gaussian) priors that reflect prior ‘ignorance’ (e.g. distributions of each of the parameters are centred on zero with very large variances so that the prior is integrable but is essentially uniform over the range of the data). Alternatively, priors can be gleaned from the literature or constructed using techniques developed for eliciting expert opinion (see Wolfson et al. 1996 for an ecological example). Initially, I used uninformative, Gaussian priors on each of the β_{i} terms in eqn 3 (β_{i} ∼ N(0, 1000)).
The computation of the posterior P(βdata) using Bayes’ Theorem often involves numerical approximations of solutions of integrals (Gelman et al. 1995; Carlin & Louis 2000), especially when priors and likelihoods are not ‘conjugate’ (i.e. are of different functional forms: Gelman et al. 1995), as in this example. Available software most frequently uses Markov chain Monte Carlo (MCMC) methods (Gilks et al. 1996). For the ant example, I used WinBUGS version 1.4 (Spiegelhalter et al. 2003), which implements MCMC methods using a Gibbs sampler (Chib & Greenberg 1995). Posterior probability distributions on the regression parameters β were sampled from normal distributions. The most credible estimates of the parameters (Table 4) using the uninformative priors and the simple additive model (eqn 3) were nearly identical to the maximum likelihood estimates (Fig. 2).
Diversity patterns of ants have been documented around the world, and so it is reasonable to use the published literature to generate more informative priors for the model parameters. I derived priors for latitudinal gradients in temperate ants from Gotelli & Arnett (2000): β_{1} ∼ N(−0.017, 0.04); for effects of elevation from Gotelli & Arnett (2000) and Brühl et al. (1999): β_{2} ∼ N (−0.002, 0.0003); and for differences between ‘open’ habitats such as bogs and ‘closed’ habitats such as forests from Jeanne (1979), Gotelli & Arnett (2000) and Kaspari et al. (2000): β_{3} ∼ N(0.37, 1). These priors are illustrated in the last column of Fig. 2, along with the posteriors estimated from these priors. Because the likelihood (i.e. the information in the data) had much smaller variance than these informative priors, the posteriors estimated from the informative priors differed only slightly from those with uninformative priors.
I also compared all the models listed in Table 3. One method of choosing among competing Bayesian models is the deviance information criterion (DIC) (Spiegelhalter et al. 2002):
 (5)
In words, DIC equals the posterior mean of the deviance of all the candidate models D(θ) plus the effective number of parameters in the model (p_{D}). The posterior mean of the deviance D(θ) itself equals −2 times the log of the likelihood, and the effective number of parameters in the model is estimated as the posterior mean of the deviance minus the deviance of the posterior means . In the absence of any prior information, DIC = AIC (eqn 3), but the inclusion of prior information results in increases in both D(θ) and the effective number of parameters (Spiegelhalter et al. 2002).
As with AIC, the model with the smallest DIC is selected to be the ‘best’ model. For the ant data set, applying the DIC to the set of models estimated with uninformative priors yielded the same result as applying AIC to the maximum likelihood models: the simple, additive model provided the bestfit with the fewest effective parameters (Table 3).
From the Bayesian analysis, the inferences are:
 1
The additive model is a believable description of how latitude, elevation, and habitat can be used to predict species richness of ants in New England, USA.
 2
There is a 95% probability that the estimated values of the model parameters in fact fall within the calculated credible sets (
Table 3).
 3
The model provides a good fit to the data.
Figure 3 illustrates expected values and associated 95% credible sets for species richness in each habitat at each sampled site. For 73% (16 of 22) of the forests and 55% (12 of 22) of the bogs sampled, the probability is at least 95% that the model accurately predicts the observed value.
Uncertainty in model selection
 Top of page
 Abstract
 Introduction
 Scientific inference
 How do ecologists use Bayesian inference?
 A worked example
 The data: a latitudinal gradient of species richness
 Classical inference on the ant data
 Bayesian inference on the ant data
 Uncertainty in model selection
 The future of Bayesian ecology
 Acknowledgments
 References
There is recognized uncertainty in the parameter estimates of both classical and Bayesian models. Less often appreciated is the uncertainty involved in selecting a particular model relative to other plausible models (Chatfield 1995; Draper 1995). Yet, the incorrect specification or choice of a statistical model can result in faulty inferences or predictions. Automated tools for model selection such as the stepAIC function in S (Venables & Ripley 2002), the MARK software (White & Burnham 1999), or the DIC function in WinBUGS (Spiegelhalter et al. 2002) may have the unintended consequence of discouraging scientists from thinking about uncertainty in model selection. Recognizing uncertainty in parameter estimates and predictions of ecological models (e.g. IPCC 2001) and communicating the uncertainty in the range of ecological models considered (Wintle et al. 2003) can lead to better understanding by ecologists of the power and limitations of statistical inference and prediction.
I considered 15 models to ‘explain’ the species richness of ants in New England (Table 3). This example is relatively simple, as many complex ecological models include dozens of factors and the number of candidate models increases exponentially with the number of predictor variables. In this example, the same model was selected using AIC and DIC, but these values differed only by a few percent among several models and it is possible that one of the other models actually may be the ‘true’ model. One way to account for uncertainty in model construction and selection is to create and use an ‘average’ model. The contribution of each individual model to the averaged model is weighted by its plausibility or posterior weight of evidence.
Frequentist model averaging is a nascent and promising area of statistical research (Claeskens & Hjort 2003; Hjort & Claeskens 2003), but it has not developed yet to the extent that it can be applied to even basic ecological problems. In contrast, Bayesian model averaging (reviewed by Hoeting et al. 1999) is an established method for combining models that has been applied only recently to ecological questions (Wintle et al. 2003). In the combined or averaged model, the individual models are weighted by their degree of plausibility. Normally, all possible individual models are not included in the averaged model. Rather, only those that meet a defined selection criterion are used. Madigan & Raftery (1994) suggested two criteria for inclusion: Occam's Window, which excludes models that predict the data ‘far less well’ (e.g. when the Bayes factor, the ratio of the posterior probabilities of the candidate model to the best model, is less than 0.05); and Occam's Razor, which excludes any complex model (e.g. more terms, more interactions) that receives less support from the data than simpler models.
Averaging generalized linear models, such as those used in the ant example, is relatively straightforward (Hoeting et al. 1999) and can be accomplished with freely available software.^{5} Using the Sfunction, bic.glm (Volinsky et al. 1997), and assigning equal prior weights to all the models, two plausible models were included in the averaged model: the additive model with all three predictors identified as previously as the ‘best’ model, and an additive model that included only habitat and latitude (Table 4). The parameter estimates were similar to the individual models, but the standard errors were larger, reflecting the uncertainty inherent in model averaging.