Using MCMC chain outputs to efficiently estimate Bayes factors

https://doi.org/10.1016/j.jmp.2011.06.004Get rights and content

Abstract

One of the most important methodological problems in psychological research is assessing the reasonableness of null models, which typically constrain a parameter to a specific value such as zero. Bayes factor has been recently advocated in the statistical and psychological literature as a principled means of measuring the evidence in data for various models, including those where parameters are set to specific values. Yet, it is rarely adopted in substantive research, perhaps because of the difficulties in computation. Fortunately, for this problem, the Savage–Dickey density ratio (Dickey & Lientz, 1970) provides a conceptually simple approach to computing Bayes factor. Here, we review methods for computing the Savage–Dickey density ratio, and highlight an improved method, originally suggested by Gelfand and Smith (1990) and advocated by Chib (1995), that outperforms those currently discussed in the psychological literature. The improved method is based on conditional quantities, which may be integrated by Markov chain Monte Carlo sampling to estimate Bayes factors. These conditional quantities efficiently utilize all the information in the MCMC chains, leading to accurate estimation of Bayes factors. We demonstrate the method by computing Bayes factors in one-sample and one-way designs, and show how it may be implemented in WinBUGS.

Highlights

► We demonstrate using conditional quantities in MCMC to estimate Bayes factors. ► We show how using conditional quantities substantially outperforms other methods. ► We apply the technique to point-null and area-null hypothesis tests. ► We provide WinBUGS code to implement the method in a simple t test case.

Section snippets

Bayes factor

In psychology, hypothesis testing is the most widely used method of making inferences from data. The goal of hypothesis testing is to assess the evidence provided by the data for or against a hypothesis. In frequentist null hypothesis significance testing, for instance, hypothesis tests assess the evidence against a null hypothesis. In this paper, we approach hypothesis testing from a model selection perspective, in which the null and alternative hypotheses are treated as separate models. The

The Savage–Dickey method

For the nested-model setup above, the Savage–Dickey method provides a convenient way to compute the Bayes factor, provided certain conditions are met. The marginal probability of the data under the null may be expressed as a restriction of the model M1: p(yθ=θ0,M1). Consequently, the Bayes factor for the null model relative to the general one is: B01=p(y|M0)p(y|M1)=p(yθ=θ0,M1)p(yM1). Because all quantities are conditioned on M1, this dependence may be dropped from the notation without

Improved Savage–Dickey estimates

Logspline density estimates and normal approximations use marginal posterior samples of θ as input but do not rely on samples of ϕ, the parameters in common across the full and restricted models. At first glance, using samples from θ may appear reasonable; after all, the marginal posterior density of θ at θ0 is exactly the quantity of interest. Yet, the sample of ϕ, in conjunction with the data, provided all the information used to sample θ in the MCMC chain. Gelfand and Smith (1990) noted that

Model and priors

We first outline the one-sample t test model, and then describe how estimates of the Bayes factor may be obtained. As is conventional to assume, the likelihood of the data is normal. It is convenient to parameterize the model in terms of standardized effect size δ=μ/σ: yiind.Normal(σδ,σ2) where i=1,,N indexes participant. We place a conventional noninformative Jeffreys prior on σ2: π(σ2)1σ2.

We must also place a prior on δ, the parameter of interest in the general model. In Bayesian parameter

One-way, between-subjects ANOVA

Our first example showed how the CMDE method can be applied to Rouder et al. ’s t test Bayes factor. Although the t test is one of the first statistical tests that students learn in introductory statistics classes, it is not as commonly used in practice as other statistical tests, such as ANOVA. The main feature of ANOVA is a multivariate null hypothesis in which all group effects are zero. We assess the performance of both normal approximation and CMDE by comparing each to the following

Discussion

In the preceding development, we have described the CMDE method for obtaining efficient estimates of posterior densities. The CMDE method is useful in computing the Bayes factor via the Savage–Dickey method in the case where the normalizing constant on the parameter of interest is known. In general, it will be expected to outperform other methods that do not make use of all the information in the MCMC chain.

We especially expect the CMDE to outperform the kernel density estimates, logsplines,

Conclusion

In foregoing examples, we have applied conditional marginal density estimation of Savage–Dickey ratios to compute Bayes factors. We show that this approach is tractable for a one-sample t test and one-way, between-subjects ANOVA. Bayes factors obtained via CMDE are computationally convenient, and are far more accurate than previously recommended kernel density, logspline, or normal approximations methods. In cases where the necessary normalizing constant for computing the CMDE is unknown,

References (38)

  • M.D. Lee

    How cognitive modeling can benefit from hierarchical Bayesian models

    Journal of Mathematical Psychology

    (2011)
  • E.-J. Wagenmakers et al.

    Bayesian hypothesis testing for psychologists: a tutorial on the SavageDickey method

    Cognitive Psychology

    (2010)
  • Ruud Wetzels et al.

    An encompassing prior generalization of the Savage–Dickey density ratio

    Computational Statistics and Data Analysis

    (2010)
  • J.O. Berger et al.

    Testing a point null hypothesis: the irreconcilability of p values and evidence

    Journal of the American Statistical Association

    (1987)
  • J.M. Bernardo et al.

    Bayesian theory

    (2000)
  • D. Blackwell

    Conditional expectation and unbiased sequential estimation

    The Annals of Mathematical Statistics

    (1947)
  • M.-H. Chen

    Importance-weighted marginal Bayesian posterior density estimation

    Journal of the American Statistical Association

    (1994)
  • Chen, M.-H., & Shao, Q.-M. (1997). Performance study of marginal posterior density estimation via Kullback–Leibler...
  • S. Chib

    Marginal likelihood from the Gibbs output

    Journal of the American Statistical Association

    (1995)
  • J.M. Dickey

    The weighted likelihood ratio, linear hypotheses on normal location parameters

    The Annals of Mathematical Statistics

    (1971)
  • J.M. Dickey et al.

    The weighted likelihood ratio, sharp hypotheses about chances, the order of a Markov chain

    The Annals of Mathematical Statistics

    (1970)
  • W. Edwards et al.

    Bayesian statistical inference for psychological research

    Psychological Review

    (1963)
  • A. Gelfand et al.

    Sampling based approaches to calculating marginal densities

    Journal of the American Statistical Association

    (1990)
  • A. Gelman et al.

    Bayesian data analysis

    (2004)
  • S. Geman et al.

    Stochastic relaxation, Gibbs distribution, and the Bayesian restoration of images

    IEEE Transactions on Pattern Analysis and Machine Intelligence

    (1984)
  • P. Heidelberger et al.

    Simulation run length control in the presence of an initial transient

    Operations Research

    (1983)
  • H. Jeffreys

    Theory of probability

    (1961)
  • R. Kass et al.

    Bayes factors

    Journal of the American Statistical Association

    (1995)
  • I. Klugkist et al.

    Bayesian model selection using encompassing priors

    Statistica Neerlandica

    (2005)
  • Cited by (64)

    • From inference to design: A comprehensive framework for uncertainty quantification in engineering with limited information

      2022, Mechanical Systems and Signal Processing
      Citation Excerpt :

      Further improvements have been identified with enhanced selection of task dependent distance metrics within the ABC regime [73,72]. Similar approaches include the Metropolis-adjusted Langevin algorithm [78], the Metropolis preconditioned Crank-Nicolson method [79], Hamiltonian MCMC [80], relativistic MCMC [81], and many others [82–86]. An appropriate likelihood metric is not readily available for the NASA challenge problem.

    • Time matters: Feature-specific prioritization follows feature integration in visual object processing

      2019, NeuroImage
      Citation Excerpt :

      Given that we tested for the null hypothesis, for this comparison, Bayes factors for dependent-group designs were computed (Rouder et al., 2009) via Gaussian quadrature, using the function ttestBF from the R package BayesFactor v0.9.12–2 (Morey et al., 2018). A non-informative Jeffreys prior was placed on the variance of the normal population (Jeffreys, 1961), while a Cauchy prior with a width of √{2}/2 was placed on the standardized effect size (Morey and Rouder, 2011; Morey et al., 2011; Rouder et al., 2012). Jeffreys (1961) categorization for the grade of evidence was used for the interpretation of Bayes factors.

    View all citing articles on Scopus
    View full text