Abstract
Bayesian inference plays an important role in phylogenetics, evolutionary biology, and in many other branches of science. It provides a principled framework for dealing with uncertainty and quantifying how it changes in the light of new evidence. For many complex models and inference problems, however, only approximate quantitative answers are obtainable. Approximate Bayesian computation (ABC) refers to a family of algorithms for approximate inference that makes a minimal set of assumptions by only requiring that sampling from a model is possible. We explain here the fundamentals of ABC, review the classical algorithms, and highlight recent developments. [ABC; approximate Bayesian computation; Bayesian inference; likelihood-free inference; phylogenetics; simulator-based models; stochastic simulation models; tree-based models.]
Introduction
Many recent models in biology describe nature to a high degree of accuracy but are not amenable to analytical treatment. The models can, however, be simulated on computers and we can thereby replicate many complex phenomena such as the evolution of genomes (Marttinen et al. 2015), the dynamics of gene regulation (Toni et al. 2009), or the demographic spread of a species (Currat and Excoffier 2004; Fagundes et al. 2007; Itan et al. 2009; Excoffier et al. 2013). Such simulator-based models are often stochastic and have multiple parameters. While it is usually relatively easy to generate data from the models for any configuration of the parameters, the real interest is often focused on the inverse problem: the identification of parameter configurations that would plausibly lead to data that are sufficiently similar to the observed data. Solving such a nonlinear inverse problem is generally a very difficult task.
Bayesian inference provides a principled framework for solving the aforementioned inverse problem. A prior probability distribution on the model parameters is used to describe the initial beliefs about what values of the parameters could be plausible. The prior beliefs are updated in light of the observed data by means of the likelihood function. Computing the likelihood function, however, is mostly impossible for simulator-based models due to the unobservable (latent) random quantities that are present in the model. In some cases, Monte Carlo methods offer a way to handle the latent variables such that an approximate likelihood is obtained, but these methods have their limitations, and for large and complex models, they are “too inefficient by far” (Green et al. 2015, p. 848). To deal with models where likelihood calculations fail, other techniques have been developed that are collectively referred to as likelihood-free inference or approximate Bayesian computation (ABC).
In a nutshell, ABC algorithms sample from the posterior distribution of the parameters by finding values that yield simulated data sufficiently resembling the observed data. ABC is widely used in systematics. For instance, Hickerson et al. (2006) used ABC to test for simultaneous divergence between members of species pairs. Fan and Kubatko (2011) estimated the topology and speciation times of a species tree under the coalescent model using ABC. Their method does not require sequence data, but only gene tree topology information, and was found to perform favorably in terms of both accuracy and computation time. Slater et al. (2012) used ABC to simultaneously infer rates of diversification and trait evolution from incompletely sampled phylogenies and trait data. They found their ABC approach to be comparable to likelihood-based methods that use complete data sets. In addition, it can handle extremely sparsely sampled phylogenies and trees containing very large numbers of species. Ratmann et al. (2012) used ABC to fit two different mechanistic phylodynamic models for interpandemic influenza A(H3N2) using both surveillance data and sequence data simultaneously. The simultaneous consideration of these two types of data allowed them to drastically constrain the parameter space and expose model deficiencies using the ABC framework. Very recently, Baudet et al. (2015) used ABC to reconstruct the coevolutionary history of host–parasite systems. The ABC-based method was shown to handle large trees beyond the scope of other existing methods.
While widely applicable, ABC comes with its own set of difficulties, that are of both computational and statistical nature. The two main intrinsic difficulties are how to efficiently find plausible parameter values and how to define what is similar to the observed data and what is not. All ABC algorithms have to deal with these two issues in some manner, and the different algorithms discussed here essentially differ in how they tackle the two problems.
The remainder of this article is structured as follows. We next discuss important properties of simulator-based models and point out difficulties when performing statistical inference with them. The discussion leads to the basic rejection ABC algorithm which is presented in the subsequent section. This is followed by a presentation of popular ABC algorithms that have been developed to increase the computational efficiency. We then consider several recent advances that aim to improve ABC both computationally and statistically. The final section provides conclusions and a discussion about likelihood-free inference methods related to ABC.
Simulator-based Models
Definition
Simulator-based models are functions that map the model parameters and some random variables to data . The functions are generally implemented as computer programs where the parameter values are provided as input and where the random variables are drawn sequentially by making calls to a random number generator. The parameters govern the properties of interest of the generated data, whereas the random variables represent the stochastic variation inherent to the simulated process.
The mapping may be as complex as needed, and this generality of simulator-based models allows researchers to implement hypotheses about how the data were generated without having to make excessive compromises motivated by mathematical simplicity, or other reasons not related to the scientific question being investigated.
Due to the presence of the random variables , the outputs of the simulator fluctuate randomly even when using exactly the same values of the model parameters . This means that we can consider the simulator to define a random variable whose distribution is implicitly determined by the distribution of and the mapping acting on for a given . For this reason, simulator-based models are sometimes called implicit models (Diggle and Gratton 1984). Using the properties of transformation of random variables, it is possible to formally write down the distribution of . For instance, for a fixed value of , the probability that takes values in an neighborhood around the observed data is equal to the probability to draw values of that are mapped to that neighborhood (Fig. 1),
(1) |
Computing the probability analytically is impossible for complex models. But it is possible to test empirically whether a particular outcome of the simulation ends up in the neighborhood of or not (Fig. 1). We will see that this property of simulator-based models plays a key role in performing inference about their parameters.
Example
As an example of a simulator-based model, we here present the simple yet analytically intractable model by Tanaka et al. (2006) for the spread of tuberculosis. We will use the model throughout the article for illustrating different concepts and methods.
The model begins with one infectious host and stops when a fixed number of infectious hosts is exceeded (Fig. 2). In the simulation, it is assumed that each infectious host randomly infects other individuals from an unlimited supply of hosts with the rate , each time transmitting a specific strain of the communicable pathogen, characterized by its haplotype. It is thus effectively assumed that a strong transmission bottleneck occurs, such that only a single strain is passed forward in each transmission event, despite the eventual genetic variation persisting in the within-host pathogen population. Further, each infected host is considered to be infectious immediately. The model states that a host stops being infectious, that is, recovers or dies, randomly with the rate , and the pathogen of the host mutates randomly within the host at the rate , thereby generating a novel haplotype under a single-locus infinite alleles model. The parameters of the model are thus . The output of the simulator is a vector of cluster sizes in the simulated population of infected hosts, where clusters are the groups of hosts infected by the same haplotype of the pathogen. After the simulation, a random sample of size is taken from the population yielding the vector of cluster sizes present in the sample. For example, corresponds to a sample of size containing one cluster with six infected hosts, one cluster with three hosts, two clusters with two hosts each, as well as seven singleton clusters. Note that this model of pathogen spread is atypical in the sense that the observation times of the infections are all left implicit in the sampling process, in contrast to the standard likelihood formulation used for infectious disease epidemiological models (Anderson and May 1992).
Difficulties in Performing Statistical Inference
Values of the parameters that are plausible in the light of the observations can be determined via statistical inference either by finding values that maximize the probability in Equation (1) for some sufficiently small or by determining their posterior distribution. In more detail, in maximum likelihood estimation, the parameters are determined by maximizing the likelihood function ,
(2) |
where is a proportionality factor that may depend on , which is needed when shrinks to zero as approaches zero. If the output of the simulator can only take a countable number of values, is called a discrete random variable and the definition of the likelihood simplifies to , which equals the probability of simulating data equal to the observed data. In Bayesian inference, the essential characterization of the uncertainty about the model parameters is defined by their conditional distribution given the data, that is, the posterior distribution ,
(3) |
where is the prior distribution of the parameters.
For complex models neither the probability in Equation (1) nor the likelihood function are available analytically in closed form as a function of , which is the reason why statistical inference is difficult for simulator-based models.
For the model of tuberculosis transmission presented in the previous section, computing the likelihood function becomes intractable if the infectious population size is large, or if the death rate (Stadler 2011). This is because for large , the state space of the process, that is, the number of different cluster vectors, grows very quickly. This makes exact numerical calculation of the likelihood infeasible because in essence, every possible path to the outcome should be accounted for (Fig. 2). Moreover, if the death rate is nonzero, the process is allowed to return to previous states which further complicates the computations. Finally, the assumption that not all infectious hosts are observed contributes additionally to the intractability of the likelihood. Stadler (2011) approached the problem using transmission trees (Fig. 3). The likelihood function stays, however, intractable because of the vast number of different trees that all yield the same observed data and thus need to be considered when evaluating the likelihood of a parameter value.
Inference via Rejection Sampling
We present here an algorithm for exact posterior inference that is applicable when can only take countably many values, that is, if is a discrete random variable. As shown above, in this case . The presented algorithm forms the basis of the algorithms for ABC discussed in the later sections.
In general, samples from the prior distribution of the parameters can be converted into samples from the posterior by retaining each sampled value with a probability proportional to . This can be done sequentially by first sampling a parameter value from the prior, and then accepting the obtained value with the probability . This procedure corresponds to rejection sampling (see e.g., Robert and Casella 2004, Chapter 2). Now with the likelihood being equal to the probability that , the latter step can be implemented for simulator-based models even when is not available analytically: we run the simulator and check whether the generated data equal the observed data. This gives the rejection algorithm for simulator-based models summarized as Algorithm 1. Rubin (1984) used it to provide intuition about how Bayesian inference about parameters works in general.
To obtain another interpretation of Algorithm 1, recall that for discrete random variables the posterior distribution is, by definition, equal to the joint distribution of and , normalized by the probability that . That is, the posterior is obtained by conditioning on the event . We can thus understand the test for equality of and on line 5 of the algorithm as an implementation of the conditioning operation.
To illustrate Algorithm 1, we generated a synthetic data set from the tuberculosis transmission model by running the simulator with the parameter values , , , and setting the population size to . We further assumed that the whole population is observed, which yielded the observed data . The assumptions about the size of the population, and that the whole population was observed, are unrealistic but they enable a comparison to the exact posterior distribution, which in this setting can be numerically computed using Theorem 1 of Stadler (2011). In this case, the histogram of samples obtained with Algorithm 1 matches the posterior distribution very accurately (Fig. 4). To obtain this result, we assumed that both of the parameters and were known and assigned a uniform prior distribution in the interval for the sole unknown parameter, the transmission rate . A total of 20 million data sets were simulated, out of which 40,000 matched (acceptance rate of 0.2%).
Fundamentals of approximate Bayesian computation
The Rejection ABC Algorithm
While Algorithm 1 produces independent samples from the posterior, the probability that the simulated data equal the observed data is often negligibly small, which renders the algorithm impractical as virtually no simulated realizations of will be accepted. The same problem holds true if the generated data can take uncountably many values, that is, when is a continuous random variable.
To make inference feasible, the acceptance criterion in Algorithm 1 can be relaxed to
(4) |
where and is a “distance” function that measures the discrepancy between the two data sets, as considered relevant for the inference. With this modification, Algorithm 1 becomes the rejection ABC algorithm summarized as Algorithm 2. The first implementation of this algorithm appeared in the work by Pritchard et al. (1999).
Algorithm 2 does not produce samples from the posterior in Equation (3) but samples from an approximation ,
(5) |
which is the posterior distribution of conditional on the event . Equation (5) is obtained by approximating the intractable likelihood function in Equation (2) with ,
(6) |
The approximation is two-fold. First, the distance function is generally not a metric in the mathematical sense, namely even if . This may happen, for example, when is defined through summary statistics that remove information from the data (see below). Second, is chosen large enough so that enough samples will be accepted. Intuitively, the likelihood of a parameter value is approximated by the probability that running the simulator with said parameter value produces data within distance of (Fig. 1).
The distance is typically computed by first reducing the data to suitable summary statistics and then computing the distance between them, so that , where is often the Euclidean or some other metric for the summary statistics. When combining different summary statistics, they are usually re-scaled so that they contribute equally to the distance (as, e.g., done by Pritchard et al. 1999).
In addition to the accuracy of the approximation , the distance and the threshold also influence the computing time required to obtain samples. For instance, if and the distance is such that if and only if , then Algorithm 2 becomes Algorithm 1 and becomes but the computing time to obtain samples from would typically be impractically large. Hence, on a very fundamental level, there is a trade-off between statistical and computational efficiency in ABC (see e.g., Beaumont et al. 2002, p. 2027).
We next illustrate Algorithm 2 and the mentioned trade-off using the previous example about tuberculosis transmission. Two distances and are considered,
(7) |
where is the number of clusters contained in the data divided by the sample size and is a genetic diversity measure defined as , where is the size of the -th cluster. For , we have and . For both and , the absolute difference between the summary statistics is used as the metric .
For this example, using the summary statistic instead of the full data does not lead to a visible deterioration of the inferred posterior when (Fig. 5a). For summary statistic , however, there is a clear difference as the posterior mode and mean are shifted to larger values of and the posterior variance is larger too (Fig. 5b). In both cases, increasing , that is, accepting more parameters, leads to an approximate posterior distribution that is less concentrated than the true posterior.
Algorithm 2 with summary statistic produces results comparable to Algorithm 1 but from the computational efficiency point of view the number of simulations required to obtain the approximate posterior differs between the two algorithms. It can be seen that for a computational budget of 100,000 simulations, the posterior obtained by Algorithm 1 differs substantially from the exact posterior, while the posterior from Algorithm 2 with is still matching it well (Fig. 6a). The relatively poor result with Algorithm 1 is due to its low acceptance rate (here 0.2%). While the accepted samples do follow the exact posterior , the algorithm did not manage to produce enough accepted realizations within the computational budget available, which implies that the Monte Carlo error of the posterior approximation remains nonnegligible.
Plotting the number of data sets simulated versus the accuracy of the inferred posterior distribution allows us to further study the trade-off between statistical and computational efficiency between the different algorithms (Fig. 6b). The accuracy is measured by the Kullback–Leibler (KL) divergence (Kullback and Leibler 1951) between the exact and the inferred posterior. Algorithm 2 with summary statistic features the best trade-off, whereas using summary statistic performs the worst. The curve of the latter one flattens out after approximately 1 million simulations, showing the approximation error introduced by using the summary statistic . For Algorithm 1, nonzero values of the KL divergence are due to the Monte Carlo error only and it will approach the true posterior as the number of simulations grows. When using summary statistics, nonzero values of the KL divergence are due to both the Monte Carlo error and the use of the summary statistics. In this particular example, the error caused by the summary statistic is, however, negligible.
Choice of the Summary Statistics
If the distance is computed by projecting the data to summary statistics followed by their comparison using a metric in the summary statistics space (e.g., the Euclidean distance), the quality of the inference hinges on the summary statistics chosen (Figs. 5 and 6).
For consistent performance of ABC algorithms, the summary statistics should be sufficient for the parameters, but this is often not the case. Additionally, with the increase in the number of summary statistics used, more simulations tend to be rejected so that an increasing number of simulation runs is needed to obtain a satisfactory number of accepted parameter values, making the algorithm computationally extremely inefficient. This is known as the curse of dimensionality for ABC (see also the discussion in the review paper by Beaumont 2010).
One of the main remedies to the above issue is to efficiently choose informative summary statistics. Importantly, the summary statistics that are informative for the parameters in a neighborhood of the true parameter value, and the summary statistics most informative globally, are significantly different (Nunes and Balding 2010). General intuition suggests that the set of summary statistics that are locally sufficient would be a subset of the globally sufficient ones. Therefore, a good strategy seems to first find a locality containing the true parameter with high enough probability and then choose informative statistics depending on that locality. However, this can be difficult in practice because rather different parameter values can produce summary statistics that are contained in the same locality.
In line with the above, Nunes and Balding (2010), Fearnhead and Prangle (2012), and Aeschbacher et al. (2012) first defined “locality” through a pilot ABC run and then chose the statistics in that locality. Four methods for choosing the statistics are generally used: (i) a sequential scheme based on the principle of approximate sufficiency (Joyce and Marjoram 2008); (ii) selection of a subset of the summary statistics maximizing prespecified criteria such as the Akaike information criterion (used by Blum et al. 2013) or the entropy of a distribution (used by Nunes and Balding 2010); (iii) partial least square regression which finds linear combinations of the original summary statistics that are maximally decorrelated and at the same time highly correlated with the parameters (Wegmann et al. 2009); (iv) assuming a statistical model between parameters and transformed statistics of simulated data, summary statistics are chosen by minimizing a loss function (Aeschbacher et al. 2012; Fearnhead and Prangle 2012). For comparison of the above methods in simulated and practical examples, we refer readers to the work by Blum and François (2010), Aeschbacher et al. (2012), and Blum et al. (2013).
Choice of the Threshold
Having the distance function specified, possibly using summary statistics, the remaining factor in the approximation of the posterior in Equation (5) is the specification of the threshold .
Larger values of result in biased approximations (see e.g., Fig. 5). The gain is a faster algorithm, meaning a reduced Monte Carlo error as one is able to produce more samples per unit of time. Therefore, when specifying the threshold the goal is to find a good balance between the bias and the Monte Carlo error. We illustrate this using Algorithm 2 with the full data without reduction to summary statistics [in other words, ]. In this case, Algorithm 2 with is identical to Algorithm 1. Here the choice results in a better posterior compared to when using a maximal number of 100,000 simulations (Fig. 7a). This means that the gain from reduced Monte Carlo error is greater than the loss incurred by the bias. But this is no longer true for where the bias dominates. Eventually, the exact method will converge to the true posterior, whereas the other two continue to suffer from the bias caused by the larger threshold (Fig. 7b). However, with smaller computational budgets (less than 2 million simulations in our example), more accurate results are obtained with the nonzero threshold .
The choice of the threshold is typically made by experimenting with a precomputed pool of simulation–parameter pairs . Rather than setting the threshold value by hand, it is often determined by accepting some small proportion of the simulations (e.g., 1%, see Beaumont et al. 2002). The choice between different options can be made more rigorous by using some of the simulated data sets in the role of the observed data and solving the inference problem for them using the remaining data sets. As the data-generating parameters are known for the simulated observations, different criteria, such as the mean squared error (MSE) between the mean of the approximation and the generating parameters can be used to make the choice [see e.g. Faisal et al. (2013) and the section on validation of ABC]. This also allows one to assess the reliability of the inference procedure. Prangle et al. (2014) discuss the use of the coverage property (Wegmann et al. 2009) as the criterion to choose the threshold value . Intuitively, the coverage property tests if the parameter values used to artificially generate a data set are covered by the credible intervals constructed from the ABC output for at correct rates (i.e., credible intervals should contain the true parameter in of the tests).
If one plans to increase the computational budget after initial experiments, theoretical convergence results can be used to adjust the threshold value. Barber et al. (2015) provide convergence results for an optimal sequence with respect to the MSE of a posterior expectation (e.g., the posterior mean). The theoretically optimal sequence for the threshold is achieved by making it proportional to as , where is the number of accepted samples. If the constant in this relation is estimated in a pilot run, one can compute the new theoretically optimal threshold based on the planned increase in the computational budget. Blum (2010) derives corresponding results using an approach based on conditional density estimation, finding that should optimally be proportional to as , where is the dimension of the parameter space and the total number of simulations performed [see also Fearnhead and Prangle (2012), Silk et al. (2013), and Biau et al. (2015), for similar results].
Beyond simple rejection sampling
The basic rejection ABC algorithm is essentially a trial and error scheme where the trial (proposal) values are sampled from the prior. We now review three popular algorithms that seek to improve upon the basic rejection approach. The first two aim at constructing proposal distributions that are closer to the posterior, whereas the third is a correction method that aims at adjusting samples obtained by ABC algorithms so that they are closer to the posterior.
Markov Chain Monte Carlo ABC
The Markov chain Monte Carlo (MCMC) ABC algorithm is based on the Metropolis–Hastings MCMC algorithm that is often used in Bayesian statistics (Robert and Casella 2004, Chapter 7). In order to leverage this algorithm, we write in Equation (5) as the marginal distribution of ,
(8) |
where denotes the probability density (mass) function of , and equals one if and zero otherwise. Importantly, while is generally unknown for simulator-based models, it is still possible to use as the target distribution in a Metropolis–Hastings MCMC algorithm by choosing the proposal distribution in the right way. The obtained (marginal) samples of then follow the approximate posterior .
Assuming that the Markov chain is at iteration in state where , the Metropolis–Hastings algorithm involves sampling candidate states from a proposal distribution and accepting the candidates with the probability ,
(9) |
Choosing the proposal distribution such that the move from to does not depend on the value of , and that is sampled from the simulator-based model with parameter value irrespective of , we have
(10) |
where is a suitable proposal distribution for . As a result of this choice, the unknown quantities in Equation (9) cancel out,
This means that the acceptance probability is only probabilistic in since a proposal is immediately rejected if the condition is not met. While the Markov chain operates in the space, the choice of the proposal distribution decouples the acceptance criterion into an ordinary Metropolis–Hastings criterion for and the previously seen ABC rejection criterion for . The resulting algorithm, shown in full in the Appendix, is known as MCMC ABC algorithm and was introduced by Marjoram et al. (2003).
An advantage of the MCMC ABC algorithm is that the parameter values do not need to be drawn from the prior, which most often hampers the rejection sampler by incurring a high rejection rate of the proposals. As the Markov chain converges, the proposed parameter values follow the posterior with some added noise. A potential disadvantage, however, is the continuing presence of the rejection condition which dominates the acceptance rate of the algorithm. Parameters in the tails of the posteriors have, by definition, a small probability to generate data satisfying the rejection condition, which can lead to a “sticky” Markov chain where the state tends to remain constant for many iterations.
Sequential Monte Carlo ABC
The sequential Monte Carlo (SMC) ABC algorithm can be considered as an adaptation of importance sampling which is a popular technique in statistics (see e.g., Robert and Casella 2004, Chapter 3). If one uses a general distribution in place of the prior , Algorithm 2 produces samples that follow a distribution proportional to . However, by weighting the accepted parameters with ,
(12) |
the resulting weighted samples follow . This kind of trick is used in importance sampling and can be employed in ABC to iteratively morph the prior into a posterior.
The basic idea is to use a sequence of shrinking thresholds and to define the proposal distribution at iteration based on the weighted samples from the previous iteration (Fig. 8). This is typically done by defining a mixture distribution,
(13) |
where is often a Gaussian distribution with mean and a covariance matrix estimated from the samples. Sampling from can be done by choosing with probability and then perturbing the chosen parameter according to . The proposed sample is then accepted or rejected as in Algorithm 2 and the weights of the accepted samples are computed with Equation (12). Such iterative algorithms were proposed by Sisson et al. (2007); Beaumont et al. (2009); Toni et al. (2009) and are called SMC ABC algorithms or population Monte Carlo ABC algorithms. The algorithm by Beaumont et al. (2009) is given in the Appendix.
Similar to the MCMC ABC, the samples proposed by the SMC algorithm follow the posterior with some added noise. The proposed parameter values are drawn from the prior only at the first iteration after which adaptive proposal distributions closer to the true posterior are used (see Fig. 8 for an illustration). This reduces the running time as the number of rejections is lower compared to the basic rejection ABC algorithm. For small values of , however, the probability to accept a parameter value becomes very small, even if the parameter value was sampled from the true posterior. This results in long computing times in the final iterations of the algorithm without notable improvements in the approximation of the posterior.
Post-Sampling Correction Methods
We assume here that the distance is specified in terms of summary statistics, that is, , with and . As decreases to zero, the approximate posterior in Equation (5) converges to , where we use to denote the conditional distribution of given a value of the summary statistics . While small values of are thus preferred in theory, making them too small is not feasible in practice because of the correspondingly small acceptance rate and the resulting large Monte Carlo error. We here present two schemes that aim at adjusting without further sampling so that the adjusted distribution is closer to .
For the first scheme, we note that if we had a mechanism to sample from , we could sample from the limiting approximate posterior by using . The post-sampling correction methods in the first scheme thus estimate and use the estimated conditional distributions to sample from . In order to facilitate sampling, is expressed in terms of a generative (regression) model,
(14) |
where is a vector-valued function and a vector of random variables for the residuals. By suitably defining , we can assume that the random variables of the vector are independent, of zero mean and equal variance, and that their distribution does not depend on . Importantly, the model does not need to hold for all because, ultimately, we would like to sample from it using only. Assuming that the model holds for and that we have (weighted) samples available from an ABC algorithm with a threshold , the model can be estimated by regressing on the summary statistics .
In order to sample using the estimated model , we need to know the distribution of . For that, the residuals are determined by solving the regression equation,
(15) |
The residuals can be used to estimate , or as usually is the case in ABC, be directly employed in the sampling of the ,
(16) |
If the original samples are weighted, both the and the new “adjusted” samples inherit the weights. By construction, if the relation between and is estimated correctly, the (weighted) samples follow with .
In most models employed so far, the individual components of are treated separately, thus not accounting for possible correlations between them. For this paragraph we thus let be a scalar. The first regression model used was linear (Beaumont et al. 2002),
(17) |
which results in the adjustment , where is the learned regression coefficient (Fig. 9). When applied to the model of the spread of tuberculosis, with summary statistic [see Equation (7)], the adjustment is able to correct the bias caused by the nonzero threshold , that is the estimated model is accurate (Fig. 10a). With summary statistic , the threshold is too large for accurate adjustment, although the result is still closer to the target distribution than the original (Figure 10b). Note also that here the target distribution of the adjustment is substantially different from the true posterior due to the bias incurred by summary statistic .
Also nonlinear models have been proposed. Blum (2010) assumed a quadratic model,
(18) |
where is a symmetric matrix that adds a quadratic term to the linear adjustment. A more general nonlinear model was considered by Blum and François (2010),
(19) |
where models the conditional mean and the conditional standard deviation of . Both functions were fitted using a multi-layer neural network, and denoting the learned functions by and , the following adjustments were obtained
(20) |
The term is an estimate of the posterior mean of , whereas is an estimate of the posterior standard deviation of the parameter. They can both be used to succinctly summarize the posterior distribution of .
A more complicated model is not necessarily better than a simpler one. It depends on the amount of training data available to fit it, that is, the amount of original samples that satisfy . The different models presented above were compared by Blum and François (2010) who also pointed out that techniques for model selection from the regression literature can be used to select among them.
While the first scheme to adjust consists of estimating , the second scheme consists of estimating , that is the conditional distribution of the summary statistics given a parameter value. The rationale of this approach is that knowing implies knowing the approximate likelihood function for , because when the distance is specified in terms of summary statistics.
Importantly, does not need to be known everywhere but only locally around , where .
If we use to denote the distribution of conditional on and , Leuenberger and Wegmann (2010) showed that takes the role of a local likelihood function and the role of a local prior, and that the local posterior equals the true posterior .
The functional form of is generally not known. However, as in the first scheme, running an ABC algorithm with threshold provides data that can be used to estimate a model of . Since the model does not need to hold for all values of the summary statistics, but only for those in the neighborhood of , Leuenberger and Wegmann (2010) proposed to model as Gaussian with constant covariance matrix and a mean depending linearly on . When the samples are used to approximate as a kernel density estimate, the Gaussianity assumption on facilitates the derivation of closed-form formulae to adjust the kernel density representation of so that it becomes an approximation of (Leuenberger and Wegmann 2010).
While Leuenberger and Wegmann (2010) modeled as Gaussian, other models can be used as well. Alternatively, one may make the mean of the Gaussian depend nonlinearly on and allow the covariance of the summary statistic depend on . This was done by Wood (2010) and the model was found rich enough to represent for all values of the summary statistics and not only for those in the neighborhood of the observed one.
Recent developments
We here present recent advances that aim to make ABC both computationally and statistically more efficient. This presentation focuses on our own work (Gutmann et al. 2014; Gutmann and Corander 2016).
Computational Efficiency
The computational cost of ABC can be attributed to two main factors:
(1) Most of the parameter values result in large distances between the simulated and observed data and those parameter values for which the distances tend to be small are unknown.
(2) Generating simulated data sets, that is, running the simulator, may be costly.
MCMC ABC and SMC ABC were partly introduced to avoid proposing parameters in regions where the distance is large. Nonetheless, typically millions of simulations are needed to infer the posterior distribution of a handful of parameters only. A key obstacle to efficiency in these algorithms is the continued presence of the rejection mechanism , or more generally, the online decisions about the similarity between and . In recent work, Gutmann and Corander (2016) proposed a framework called Bayesian optimization for likelihood-free inference (BOLFI) for performing ABC which overcomes this obstacle by learning a probabilistic model about the stochastic relation between the parameter values and the distance (Fig. 11). After learning, the model can be used to approximate , and thus , for any without requiring further runs of the simulator (Fig. 12).
Like the post-sampling correction methods presented in the previous section, BOLFI relies on a probabilistic model to make ABC more efficient. However, the quantities modeled differ, since in the post-sampling correction methods the relation between summary statistics and parameters is modeled, while BOLFI focuses on the relation between the parameters and the distance. A potential advantage of the latter approach is that the distance is a univariate quantity while the parameters and summary statistics may be multidimensional. Furthermore, BOLFI does not assume that the distance is defined via summary statistics and can be used without first running another ABC algorithm.
Learning of the model of requires data about the relation between and . In BOLFI, the data are actively acquired focusing on regions of the parameter space where the distance tends to be small. This is achieved by leveraging techniques from Bayesian optimization (see e.g., Jones 2001; Brochu et al. 2010), hence its name. Ultimately, the framework provided by Gutmann and Corander (2016) reduces the computational cost of ABC by addressing both of the factors mentioned above. The first point is addressed by learning from data which parameter values tend to have small distances, whereas the second problem is resolved by focusing on areas where the distance tends to be small when learning the model and by not requiring further runs of the simulator once the model is learned.
While BOLFI is not restricted to a particular model for , Gutmann and Corander (2016) used Gaussian processes in the applications in their paper. Gaussian processes have also been used in other work as surrogate models for quantities that are expensive to compute. Wilkinson (2014) used them to model the logarithm of , and the training data were constructed based on quasi-random numbers covering the parameter space. Meeds and Welling (2014) used Gaussian processes to model the empirical mean and covariances of the summary statistics as a function of . Instead of simulating these quantities for every , values from the model were used in a MCMC algorithm in approximating the likelihood. These approaches have been demonstrated to assist in speeding up ABC.
Statistical Efficiency
We have seen that the statistical efficiency of ABC algorithms depends heavily on the summary statistics chosen, the distance between them, and the locality of the inference. In a recent work, (Gutmann et al. 2014) formulated the problem of measuring the distance between simulated and observed data as a classification problem: Two data sets are judged maximally similar if they cannot be told apart significantly above chance level (50% accuracy in the classification problem). On the other hand, two data sets are maximally dissimilar if they can be told apart with 100% classification accuracy. In essence, classification is used to assess the distance between simulated and observed data.
The classification rule used to measure the distance was learned from the data, which simplifies the inference since only a function (hypothesis) space needs to be prespecified by the user. In the process, Gutmann et al. (2014) also chose a subset or weighted (nonlinear) combination of summary statistics to achieve the best classification accuracy. This choice depended on the parameter values used to generate the simulated data. While computationally more expensive than the traditional approach, the classifier approach has the advantage of being a data-driven way to measure the distance between the simulated and observed data that respects the locality of the inference.
Validation of abc
Due to the several levels of approximation, it is generally a recommendable practice to perform validatory analyses of the ABC inferences. We here discuss some of the possibilities suggested in the literature.
The ability to generate data from simulator-based models enables basic sanity checks for the feasibility of the inference with a given setting and algorithm. The general approach is to perform inference where synthetic data sets are generated with known parameter values to play the role of the observed data . To assess whether the posterior distribution is concentrated around the right parameter values, one may then compute the average error between the posterior mean (mode) and , or the expected squared distance between the posterior samples and (Wegmann et al. 2009). To assess whether the spread of the posterior distribution is not overly large or small, one may compute confidence (credibility) intervals and check their coverage. When the nominal confidence levels are accurate, 95% confidence intervals, for example, should contain in 95% of the simulation experiments (Wegmann et al. 2009; Prangle et al. 2014). Such tests can be performed a priori by sampling from the prior before having seen the actual data to be analyzed, or also a posteriori by sampling from the inferred posterior or from the prior restricted to some area of interest (Prangle et al. 2014). Corresponding techniques have also been suggested for the purpose of specifying the threshold value as discussed earlier in this article. It can be also beneficial here to store the generated data sets together with their parameter values so that the validations can be run without having to regenerate new data on every occasion.
The ABC framework provides a straightforward way to investigate the goodness-of-fit of the model. The distances indicate how close the simulated data are to the observed data . If all of the distances remain large, it may be an indication of a deficient model, as the model is unable to produce data similar to the observed data. Ratmann et al. (2009) proposed a method called ABC under model uncertainty (ABC) where they augment the likelihood with unknown error terms for each of the different summary statistics used. The error terms are assumed to have mean zero and are sampled together with the parameters of the model. If, however, the mean of the error terms is found to deviate from 0, it may indicate a systematic error in the model.
Yet another issue is to consider identifiability of the model given the observed data. The likelihood function indicates the extent to which parameter values are congruent with the observed data. A strong curvature at its maximum indicates that the maximizing parameter value is clearly to be preferred, whereas a minor curvature means that several other parameter values are nearly equally supported by the data. More generally, if the likelihood surface is mostly flat over the parameter space, the data are not providing sufficient information to identify the model parameters. While the likelihood function is generally not available for simulator-based models, the arguments provided do also hold for the approximate likelihood function in Equation (6). On one hand, the approximate likelihood function can be used to investigate the identifiability of the simulator-based model. On the other hand, it allows one to assess the quality of the distance or threshold chosen. Flat approximate likelihood surfaces, for instance, indicate that could be too large or that the distance function is not able to accurately measure differences between the data sets.
The approximate likelihood can be obtained either by the method of Gutmann and Corander (2016) or also by any other ABC algorithm by assuming a uniform prior on a region of interest. Lintusaari et al. (2016) used such an approach to investigate the identifiability of the tuberculosis model considered as an example in the previous sections, and to compare different distance functions. Further, one may (visually) compare the (marginal) prior and the inferred (marginal) posterior (e.g., Blum 2010). Both approaches are applicable not only to the real observed data but also to the synthetic data for which the data-generating parameters are known. If the employed ABC algorithm is working appropriately, both and the posteriors should clearly change when the characteristics of the observed data change markedly. In particular, if the number of observations is increased, the approximate likelihood and posterior should in general become more concentrated around the data-generating parameter values. While failure to pass such sanity checks may be an indicator that the choice of and could be improved, it can also indicate that the model may not be fully identifiable.
Conclusion
It is possible to model complex biological phenomena in a realistic manner with the aid of simulator-based models. However, the likelihood function for such models is usually intractable and raises serious methodological challenges to perform statistical inference. ABC has become synonymous for approximate Bayesian inference for simulator-based models. We have here reviewed its foundations, the most widely considered inference algorithms, together with recent advances that increase its statistical and computational efficiency.
While the review is solely restricted to Bayesian methods, there exists a large body of literature on non-Bayesian approaches, for instance, the methods of simulated moments (McFadden 1989; Pakes and Pollard 1989) or indirect inference (Gouriéroux et al. 1993; Heggland and Frigessi 2004), both having their origin in econometrics.
We focused on the central topics related to parameter inference with ABC. Nevertheless, ABC is also applicable to model selection (see e.g., the review by Marin et al. 2012) and while we have reviewed methods making the basic ABC algorithms more efficient, we have not discussed the important topic of how to use ABC for high-dimensional inference. We point the interested readers to the work by Li et al. (2015) and also to the discussion by Gutmann and Corander (2016).
For practical purpose, there exist multiple software packages implementing the different ABC algorithms, summary statistic selection, validation methods, post processing, and ABC model selection methods. Nunes and Prangle (2015) provide a recent list of available packages with information about their implementation language, platform, and targeted field of study. In summary, ABC is currently a very active methodological research field and this activity will likely result in several advances to improve its applicability to answering important biological research questions in the near future.
Appendix
For completeness, we state below the algorithms for MCMC ABC and SMC ABC by Marjoram et al. (2003) and Beaumont et al. (2009), respectively.
Acknowledgments
We acknowledge the computational resources provided by the Aalto Science-IT project. J.L., M.U.G., R.D. and J.C. wrote the article; J.L. performed the simulations; S.K. contributed to writing and planning of the article.
Funding
This work was supported by the Academy of Finland (Finnish Centre of Excellence in Computational Inference Research COIN).
References
- Aeschbacher S., Beaumont M., Futschik A. 2012. A novel approach for choosing summary statistics in approximate Bayesian computation. Genetics 192:1027–1047. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Anderson R.M., May R.M. 1992. Infectious diseases of humans: dynamics and control. Oxford University Press. [Google Scholar]
- Barber S., Voss J., Webster M. 2015.. The rate of convergence for approximate Bayesian computation. Electron. J. Stat. 80–105. [Google Scholar]
- Baudet C., Donati B., Sinaimeri B., Crescenzi P., Gautier C., Matias C., Sagot M.-F. 2015.. Cophylogeny reconstruction via an approximate Bayesian computation. Syst. Biol. 64:416–431. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Beaumont M.A. 2010.. Approximate Bayesian computation in evolution and ecology. Annu. Rev. Ecol. Evol. Syst. 41:379–406. [Google Scholar]
- Beaumont M.A., Cornuet J.-M., Marin J.-M., Robert C.P. 2009. Adaptive approximate Bayesian computation. Biometrika 96:983–990. [Google Scholar]
- Beaumont M.A., Zhang W., Balding D.J. 2002.. Approximate Bayesian computation in population genetics. Genetics 162:2025–2035. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Biau G., Cérou F., Guyader A. 2015. New insights into approximate Bayesian computation. Ann. I. H. Poincaré B 51:376–403. [Google Scholar]
- Blum M., François O. 2010.. Non-linear regression models for approximate Bayesian computation. Stat. Comput. 20:63–73. [Google Scholar]
- Blum M.G.B. 2010. Approximate Bayesian computation: a nonparametric perspective. J. Ame. Stat. Assoc. 105:1178–1187. [Google Scholar]
- Blum M.G.B., Nunes M.A., Prangle D., Sisson S.A. 2013. A comparative review of dimension reduction methods in approximate Bayesian computation. Stat. Sci. 28:189–208. [Google Scholar]
- Brochu E., Cora V., de Freitas N. 2010. A tutorial on Bayesian optimization of expensive cost functions, with application to active user modeling and hierarchical reinforcement learning. arXiv:1012.2599. [Google Scholar]
- Currat M., Excoffier L. 2004. Modern humans did not admix with neanderthals during their range expansion into europe. PLoS Biol. 2:e421.. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Diggle P.J., Gratton R.J. 1984. Monte Carlo methods of inference for implicit statistical models. J. Roy. Stat. Soc. B 46:193–227. [Google Scholar]
- Excoffier L.Dupanloup I. Huerta-Snchez E.Sousa V.C.Foll M.. 2013. Robust demographic inference from genomic and SNP data. PLoS Genet. 9:e1003905. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Fagundes N.J.R., Ray N., Beaumont M., Neuenschwander S., Salzano F.M., Bonatto S.L., Excoffier L. 2007. Statistical evaluation of alternative models of human evolution. Proc. Natl Acad. Sci. 104:17614–17619. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Faisal M., Futschik A., Hussain I. 2013. A new approach to choose acceptance cutoff for approximate Bayesian computation. J. Appl. Stat. 40:862–869. [Google Scholar]
- Fan H.H., Kubatko L.S. 2011. Estimating species trees using approximate Bayesian computation. Mol. Phylogenet. Evol. 59:354–363. [DOI] [PubMed] [Google Scholar]
- Fearnhead P., Prangle D. 2012. Constructing summary statistics for approximate Bayesian computation: semi-automatic approximate Bayesian computation. J. Roy. Stat. Soc. B 74:419–474. [Google Scholar]
- Gouriéroux C., Monfort A., Renault E. 1993. Indirect inference. J. Appl. Econ. 8:S85–S118. [Google Scholar]
- Green P., Latuszynski K., Pereyra M., Robert C.P. 2015. Bayesian computation: a summary of the current state, and samples backwards and forwards. Stat. Comput. 25:835–862. [Google Scholar]
- Gutmann M.U., Corander J. 2016.. Bayesian optimization for likelihood-free inference of simulator-based statistical models. J. Mach. Learn. Res. 17 (125):1–47. [Google Scholar]
- Gutmann M.U., Dutta R., Kaski S., Corander J. 2014.. Statistical inference of intractable generative models via classification. arXiv:1407.4981. [Google Scholar]
- Heggland K., Frigessi A. 2004. Estimating functions in indirect inference. J. Roy. Stat. Soc. B 66:447–462. [Google Scholar]
- Hickerson M.J., Stahl E.A., Lessios H.A. 2006. Test for simultaneous divergence using approximate Bayesian computation. Evolution 60:2435–2453. doi:10.1111/j.0014-3820.2006.tb01880.x [PubMed] [Google Scholar]
- Itan Y., Powell A., Beaumont M.A., Burger J., Thomas M.G. (2009). The origins of lactase persistence in Europe. PLoS Comput. Biol. 5:e1000491. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Jones D. 2001. A taxonomy of global optimization methods based on response surfaces. J. Glob. Optim. 21:345–383. [Google Scholar]
- Joyce P., Marjoram P. 2008. Approximately sufficient statistics and Bayesian computation. Stat. Appl. Genet. Mol. Biol. 26. [DOI] [PubMed] [Google Scholar]
- Kullback S., Leibler R.A. 1951. On information and sufficiency. Ann. Math. Stat. 22:79–86. [Google Scholar]
- Leuenberger C., Wegmann D. 2010. Bayesian computation and model selection without likelihoods. Genetics 184:243–252. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Lintusaari J., Gutmann M.U., Kaski S., Corander J. 2016. On the identifiability of transmission dynamic models for infectious diseases. Genetics 202(3):911–918. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Li J., Nott D.J., Sisson S.A. Extending approximate Bayesian computation methods to high dimensions via Gaussian copula. 2015. arXiv:1504.04093. [Google Scholar]
- Marin J.-M., Pudlo P., Robert C., Ryder R. 2012. Approximate Bayesian computational methods. Stat. Comput. 22:1167–1180. [Google Scholar]
- Marjoram P., Molitor J., Plagnol V., Tavaré S. 2003.. Markov chain Monte Carlo without likelihoods. Proc. Natl Acad. Sci. 100:15324–15328. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Marttinen P., Croucher N.J., Gutmann M.U., Corander J., Hanage W.P. Recombination produces coherent bacterial species clusters in both core and accessory genomes. Proc. Natl Acad. Sci. (PNAS). 2015. doi: 10.1099/mgen.0.000038. [DOI] [PMC free article] [PubMed] [Google Scholar]
- McFadden D. 1989. A method of simulated moments for estimation of discrete response models without numerical integration. Econometrica 57:995–1026. [Google Scholar]
- Meeds E., Welling M. 2014. GPS-ABC: Gaussian process surrogate approximate Bayesian computation. Proceedings of the 30th Conference on Uncertainty in Artificial Intelligence (UAI). [Google Scholar]
- Nunes M.A., Balding D.J. 2010. On optimal selection of summary statistics for approximate Bayesian computation. Stat. Appl. Genet. Mol. Bio. 9. [DOI] [PubMed] [Google Scholar]
- Nunes M.A., Prangle D. abctools: an R package for tuning approximate Bayesian computation analyses. R Journal. To appear. 2015. [Google Scholar]
- Pakes A., Pollard D. 1989. Simulation and the asymptotics of optimization estimators. Econometrica 57:1027–1057. [Google Scholar]
- Prangle D.Blum M.G.B., Popovic G.Sisson S.A.. 2014. Diagnostic tools for approximate Bayesian computation using the coverage property. Aust. NZ J. Stat. 56:309–329. [Google Scholar]
- Pritchard J.K., Seielstad M.T., Perez-Lezaun A., Feldman M.W. 1999. Population growth of human Y chromosomes: a study of Y chromosomemicrosatellites. Mol. Biol. Evol. 16:1791–1798. [DOI] [PubMed] [Google Scholar]
- Ratmann O., Andrieu C., Wiuf C., Richardson S. 2009. Model criticism based on likelihood-free inference, with an application to protein network evolution. Proc. Natl Acad. Sci. 106:10576–10581. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Ratmann O., Donker G., Meijer A., Fraser C., Koelle K. 2012. Phylodynamic inference and model assessment with approximate Bayesian computation: influenza as a case study. PLoS Comput. Biol. 8:e1002835. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Robert C., Casella G. 2004.. Monte Carlo statistical methods. 2nd ed. Springer. [Google Scholar]
- Rubin D.B. 1984. Bayesianly justifiable and relevant frequency calculations for the applied statistician. Ann. Stat. 12:1151–1172. [Google Scholar]
- Silk D., Filippi S., Stumpf M.P. 2013. Optimizing threshold-schedules for sequential approximate Bayesian computation: applications to molecular systems. Stat. Appl. Genet. Mol. Biol. 12:603–618. [DOI] [PubMed] [Google Scholar]
- Sisson S.A., Fan Y., Tanaka M.M. 2007. Sequential Monte Carlo without likelihoods. Proc. Natl Acad. Sci. 104:1760–1765. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Slater G.J., Harmon L.J., Wegmann D., Joyce P., Revell L.J., Alfaro M.E. 2012. Fitting models of continuous trait evolution to incompletely sampled comparative data using approximate Bayesian computation. Evolution 66:752–762. [DOI] [PubMed] [Google Scholar]
- Stadler T. 2011. Inferring epidemiological parameters on the basis of allele frequencies. Genetics 188:663–672. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Tanaka M.M., Francis A.R., Luciani F., Sisson S.A. 2006. Using approximate Bayesian computation to estimate tuberculosis transmission parameters from genotype data. Genetics 173:1511–1520. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Toni T., Welch D., Strelkowa N., Ipsen A., Stumpf M.P. 2009. Approximate Bayesian computation scheme for parameter inference and model selection in dynamical systems. J. Roy. Soc. Interf. 6:187–202. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Wegmann D., Leuenberger C., Excoffier L. 2009. Efficient approximate Bayesian computation coupled with Markov chain Monte Carlo without likelihood. Genetics 182:129–141. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Wilkinson R. 2014. Accelerating ABC methods using Gaussian processes. Proceedings of the 17th International Conference on Artificial Intelligence and Statistics (AISTATS). [Google Scholar]
- Wood S. 2010. Statistical inference for noisy nonlinear ecological dynamic systems. Nature 466:1102–1104. [DOI] [PubMed] [Google Scholar]