Jump to ContentJump to Main Navigation
Ecological StatisticsContemporary theory and application$

Gordon A. Fox, Simoneta Negrete-Yankelevich, and Vinicio J. Sosa

Print publication date: 2015

Print ISBN-13: 9780199672547

Published to Oxford Scholarship Online: April 2015

DOI: 10.1093/acprof:oso/9780199672547.001.0001

Show Summary Details
Page of

PRINTED FROM OXFORD SCHOLARSHIP ONLINE (www.oxfordscholarship.com). (c) Copyright Oxford University Press, 2017. All Rights Reserved. Under the terms of the licence agreement, an individual user may print out a PDF of a single chapter of a monograph in OSO for personal use (for details see http://www.oxfordscholarship.com/page/privacy-policy). Subscriber: null; date: 23 May 2017

(p.334) (p.335) Appendix Probability distributions

(p.334) (p.335) Appendix Probability distributions

Ecological Statistics
Oxford University Press

Random variables are variables whose possible values are the outcomes of random processes. The probability distribution for a particular random variable describes the chance of occurrence of each possible value of that variable. We denote the random variable of interest as Y, and y is used to denote a specific value taken by that variable. Discrete random variables (e.g., count data) consist of values from a countable set (that is, a quantity that can be represented by integers). The probability that a discrete random variable takes on each of the set of possible values (e.g., a butterfly might lay 20, 21, 22 eggs on a leaf) is described by a probability mass function (PMF). Continuous random variables (e.g., lengths, rates, probabilities) consist of real values, and can take any value in some range (e.g., the mass of each butterfly egg can vary by quantities much smaller than we can ever measure). The probability density function (PDF) describes how the probability changes as the measurement changes. Consult basic statistics books for more detail.

Each PMF and PDF is described by one or more parameters that determine the shape of the distribution. The most common shape measurements are the mean, variance, and skewness, which describe the central tendency, the spread, and the asymmetry of the distribution, respectively. Distributions can be written in a number of mathematically equivalent ways, all with the same number of parameters. Why choose one of these as opposed to another? Some ways of writing these distributions are easier to interpret biologically, or to work with mathematically. Because the mean is such a useful descriptor, for all of the probability distributions presented in this appendix, we show how to calculate the mean, along with other useful parameters. These parameters are not always provided by software packages.

Because many statistical analyses, especially those involving likelihoods, require calculating the natural logarithm of a probability distribution (see chapter 3), in this appendix we present both the distribution/mass function and its natural logarithm (henceforth referred to as lnPDF or lnPMF), for each distribution.

This appendix provides only a summary of some of the more frequently used probability distributions mentioned throughout the book. As with the rest of the book, R code for the figures is available at our online site; you may find it useful to perform numerical experiments aimed at deepening your understanding of how the parameters affect the distributions. We have not included commonly encountered statistical PDFs that are used when performing null-hypothesis tests, such as the Student’s t-distribution, the F-distribution, and the chi-squared distribution, because they are mainly used for hypothesis testing, while the distributions discussed below are often used for models of statistical populations.

(p.336) A.1 Continuous random variables

A.1.1 Normal distribution (chapters 1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, and 13)

The Normal distribution is the most commonly used continuous probability distribution. It assumes that variation is symmetric about the mean μ‎. The typical form of this distribution is:


where σ2 is the variance of Y; see figure A.1 for some examples of the PDF. As discussed above, it is frequently more useful to work with the lnPDF:


Although this distribution takes on values from minus infinity to plus infinity, it is often used for variables that can only take on positive values. This misspecification is usually not problematic if the mean is sufficiently large and the standard deviation is small, so that negative outcomes are extremely unlikely.

Appendix Probability distributions

Fig. A.1 PDF for the Normal distribution, for mean μ=0; the solid and dashed lines are for σ=(1,2), respectively.

A.1.2 Lognormal distribution (chapters 3, 5, 6, and 13)

If a continuous random variable is positive (y>0), expected to have positive skew, and intermediate values are most likely, then the lognormal distribution may be appropriate. Some care is needed in using this distribution, because it describes the case in which the logarithm of y is normally distributed; this makes it essential to distinguish between y and its log, and between quantities like the mean or variance of y and the mean or variance of its log. If we set μ‎ as the mean of ln(y) and σ‎ as the standard deviation of ln(y), the typical form of this distribution is:


(p.337) See figure A.2 for some examples of the PDF. While μ and σ2 are the mean and variance of ln(y), they are not the mean and variance of the lognormal distribution; the mean is E[Y]=eμ+σ2/2, the median is eμ, and the variance is Var[Y]=eσ21e2μ+σ2. It is sometimes convenient to rewrite the PDF with new parameters m and ϕ‎, so that the variance positively scales with ϕ‎ (so ϕ‎ is called a variance parameter); then the lnPDF for the lognormal distribution is:


In this case EY=m and Var[Y]=(eϕ21)m2. Ecologists frequently use the lognormal distribution in studies of individual growth, time series analyses of populations, and species abundance distributions.

Appendix Probability distributions

Fig. A.2 PDF for the lognormal distribution, for μ=(0.5,2), σ=1.

A.1.3 Gamma distribution (chapters 3, 6, 12, and 13)

If a continuous random variable is positive (y>0) and expected to have positive skew, but there is the possibility of lower values always being more likely, then the gamma distribution may be a good model. The typical form of this distribution is:

fgy|a,b=ya1ey/bΓabafor a,b>0.

See figure A.3 for some examples of the PDF. The mean of this distribution is E[Y]=ab, and Var[Y]=ab2. The lnPDF is given by:


where Γ is the complete gamma function.

Appendix Probability distributions

Fig. A.3 PDF for the gamma distribution, for a=(0.8,1.1,5),b=2.

(p.338) The complete gamma function is essentially an extension of the factorial function, to include positive numbers that are not integers. (Recall that, for a positive integer n, the factorial n! is the product of n and all smaller positive integers—e.g., 4!=4×3×2×1=24.) The relationship between factorials and the complete gamma is Γ(n)=n1! for any positive integer n. The general formula (for any positive number q) is Γ(q)=0xq1exp(x)dx. Factorials may seem more intuitive to you, but they are more problematic computationally, especially for large n; we recommend getting used to the complete gamma function!

There are several widely used alternative parameterizations of the gamma distribution, all of which are mathematically equivalent. For example, the gamma distribution can be formulated in terms of its mean, μ, and a positive variance parameter ϕ‎, by setting a=μ/ϕ and b=ϕ. In this case the variance is Var[Y]=μϕ. The gamma distribution arises naturally in event–time data, as the sum of time intervals that are each exponentially distributed, or as the waiting time until a given number of events has occurred. The gamma distribution is also an important component of mixture models; see discussion of the negative binomial distribution.

A.1.4 Exponential distribution (chapters 5 and 6)

If a stochastic event occurs at some fixed rate λ‎ (the event rate), then the time between consecutive events is described by an exponential distribution. The typical form of this distribution is:


See figure A.4 for some examples of the PDF. The lnPDF is:


(p.339) This distribution can only take non-negative values, and the event rate must also be positive. The mean of Y is E[Y]=μ=λ1, and the variance of Y is Var[Y]=λ2. This distribution is most often used to describe event times, like time to death or flowering; exponentially distributed survival times mean a Type II survival curve. In ecology the exponential distribution is frequently taken as a null model for event times.

Appendix Probability distributions

Fig. A.4 PDF for the exponential distribution, for λ=(1,5).

A.1.5 Weibull distribution (chapter 5)

If the rate at which events occur increases or decreases over time, then the time to the first event can be described by the Weibull distribution. Suppose the event occurs at rate (a/b)ta1 at time t. Then for a>1 the rate increases over time, for a=1 the rate is constant, and for a<1 the rate decreases over time. The typical form of this distribution is:


See figure A.5 for some examples of the PDF. The lnPDF is:


The Weibull is a generalization of the exponential distribution; if a=1, the expressions above are the same as for the exponential. For the time to the first event, the mean is E[Y]=bΓ(1+1/a), and the variance is Var[Y]=b2[Γ(1+2/a)(Γ(1+1/a))2]. This distribution can only model non-negative values. Ecologists frequently use this distribution when performing survival analyses, in which case the event rate corresponds to the age-dependent mortality rate. For each individual studied, the first event being modeled is death.

Appendix Probability distributions

Fig. A.5 PDF for the Weibull distribution, for a=(0.8,1.5),b=1.2.

(p.340) A.1.6 Beta distribution (chapters 3, 6, 12, and 13)

If a continuous random variable is bounded by [0,1] (e.g., it describes a probability or a proportion), then the beta distribution can be a good choice. The typical form of this distribution is:


(p.341) See figure A.6 for some examples of the PDF. The lnPDF is:


The mean is EY=aa+b and the variance is Var[Y]=ab(a+b)2(a+b+1). This distribution is sometimes parameterized in terms of the mean, μ, and a dispersion parameter ϕ. In this case a=μ/ϕ and b=(1μ)/ϕ, which gives E[Y]=μ and Var[Y]=μ(1μ)ϕ/(1+ϕ). Ecologists have used the beta distribution to model quantities like the fraction of plant cover in a habitat, but recent use of this distribution is mainly to model random variation in the binomial parameter (overdispersion; see beta-binomial distribution, below).

Appendix Probability distributions

Fig. A.6 PDF for the beta distribution, for a range of values of a and b.

A.2 Discrete random variables

A.2.1 Poisson distribution (chapters 3, 4, 6, 8, 12, and 13)

Count data in ecology are usually (in theory) unbounded and positively skewed (y0). If events occur at some constant rate, then the number of events counted during a fixed interval is given by the Poisson distribution. The typical form of the Poisson PMF is:


See figure A.7 for some examples of the PMF. The lnPMF is:

Appendix Probability distributions

Fig. A.7 PMF for the Poisson distribution, for μ=(2,10).

We use the complete gamma function here, rather than a factorial, because it is much easier to compute. The expected number of counts is equal to the variance among counts, so E[Y]=Var[y]=μ. Alternatively, this distribution can be used to describe the number of (p.342) subjects counted in an area of given size when subjects are randomly distributed in space with given density. Ecologists frequently use this distribution as a simple model for the numbers of individuals counted in a unit area, transect, or similar measure.

A.2.2 Binomial distribution (chapters 3, 4, 6, 7, 8, 12, and 13)

Binomial distributions are used for data with two possible outcomes that occur with probability p and 1p. Thus the binomial is quite different from the Poisson: the binomial models the number of successes or failures in a known number of trials (say, the number of seeds that germinate, of a known number planted), while the Poisson models the total number of units (say, the number of seeds found in a quadrat), with no fixed maximum. For n binomial trials, the PMF for the number of successes (0yn) is:


Here, (ny)=n!k!(nk)! is the binomial coefficient, often read as “n choose k.”

See figure A.8 for some examples of the PMF. The lnPMF is:


This distribution has mean E[Y]=np and variance Var[Y]=np(1p) Ecologists frequently use this distribution when modeling outcomes like the number of seeds that germinate, or the number of individuals surviving a season.

Appendix Probability distributions

Fig. A.8 PMF for the binomial distribution, for n=30,p=(0.2,0.7).

(p.343) A.2.3 Negative binomial distribution (chapters 3, 6, 8, 12, and 13)

Often ecological count data are collected for which the variance is much greater than the mean. One discrete distribution for this case is the negative binomial; mathematically this distribution comes from allowing a Poisson distribution to have a parameter (the mean) that varies according to a gamma distribution. There are many different parameterizations of the negative binomial distribution. One that is especially useful for ecologists models the observed number of counts, y, given a mean, μ, and a positive clustering coefficient k:


See figure A.9 for some examples of the PMF. The lnPMF is:


This PMF has mean E[Y]=μ, and variance Var[Y]=μ(1+μ/k). As k becomes large, the variance approaches the mean and the negative binomial approaches the Poisson distribution. In many ecological settings, k<1.

Lindén and Mäntyniemi (2011) provide a derivation (and examples) of a useful generalization of the negative binomial that allows researchers more flexibility in modeling overdispersion. Their approach is to use a second parameter in the mean–variance relationship, so that Var[Y]=μ(1+ϕ1+ϕ2μ); both ϕ1 and ϕ2 are non-negative. This approach allows models in which the mean–variance relationship is Poisson (ϕx=ϕ2=0), linear (ϕ2=0), or quadratic. If we write a=μ/(ϕ1+ϕ2μ) and b=1/(ϕ1+ϕ2μ), the lnPMF is:

Appendix Probability distributions

Fig. A.9 PMF for the negative binomial distribution, for k=20,μ=(8,15).

(p.344) A.2.4 Beta-binomial distribution (chapters 3 and 12)

Suppose n binomial trials occur and the probability that each of the n trials is a success is drawn from a beta distribution with mean p and dispersion parameter θ; large values of θ mean that there is small overdispersion. If we are interested in the number of successes, then we have the beta-binomial distribution. The PMF describing the number of successes (0yn) is:

Appendix Probability distributions

Fig. A.10 PMF for the beta-binomial distribution, for p=0.4, n=20, θ=(0.4,4). This plot requires the emdbook library.

While this looks complicated, it reduces to the binomial for very large θ (that is, small overdispersion). For large overdispersion (as θ approaches 0), the mass is concentrated at zero (all failures) and n (all successes), with Pbb(Y=0|n,p,0)=1p and Pbb(Y=n|n,p,0)=p. See figure A.10 for some examples of the PMF. The lnPMF is:

lnPbb(Y=y|n,p,θ)=ln[Γ(θ)]+ln[Γ(n+1)]+ln[Γ(y+pθ)]+ln{Γ[ny+(1p)θ]}                     ln[Γ(pθ)]ln{Γ[(1p)θ]}ln[Γ(y+1)]ln[Γ(ny+1)]ln[Γ(n+θ)].

This distribution has a mean of E[Y]=np and a variance of


The last term in the variance is the variance inflation factor, relative to the binomial distribution; if θ is very large, the variance inflation factor approaches 0 because the denominator in the fraction becomes very large. There are many alternative parameterizations of the beta-binomial; the example presented in chapter 3 replaces {θ} with 1/ϕ. The beta-binomial is often used in ecology to model binary data (e.g., presence/absence, survived/died, success/failure of fertilization) when the probability of success varies among sample units.