Manipulating and summarizing posterior simulations using random variable objects

Abstract

Practical Bayesian data analysis involves manipulating and summarizing simulations from the posterior distribution of the unknown parameters. By manipulation we mean computing posterior distributions of functions of the unknowns, and generating posterior predictive distributions. The results need to be summarized both numerically and graphically.

We introduce, and implement in R, an object-oriented programming paradigm based on a random variable object type that is implicitly represented by simulations. This makes it possible to define vector and array objects that may contain both random and deterministic quantities, and syntax rules that allow to treat these objects like any numeric vectors or arrays, providing a solution to various problems encountered in Bayesian computing involving posterior simulations.

We illustrate the use of this new programming environment with examples of Bayesian computing, demonstrating missing-value imputation, nonlinear summary of regression predictions, and posterior predictive checking.

This is a preview of subscription content, log in to check access.

References

  1. Chib, S.: Marginal likelihood from the Gibbs output. J. Am. Stat. Assoc. 90, 1313–1321 (1995)

    MATH  Article  Google Scholar 

  2. Chib, S., Jeliazkov, I.: Marginal likelihood from the Metropolis-Hastings output. J. Am. Stat. Assoc. 96, 270–281 (2001)

    MATH  Article  Google Scholar 

  3. Gelfand, A.E., Smith, A.F.M.: Sampling-based approaches to calculating marginal densities. J. Am. Stat. Assoc. 94, 247–253 (1990)

    Article  Google Scholar 

  4. Gelman, A., Carlin, J.B., Stern, H.S., Rubin, D.B.: Bayesian Data Analysis, 2nd edn. Chapman & Hall/CRC, London (2003)

    Google Scholar 

  5. Gelman, A., King, G.: A unified model for evaluating electoral systems and redistricting plans. Am. J. Political Sci. 38, 514–554 (1994)

    Article  Google Scholar 

  6. Gelman, A., King, G., Boscardin, W.J.: Estimating the probability of events that have never occurred: when does your vote matter? J. Am. Stat. Assoc. 93, 1–9 (1998)

    MATH  Article  Google Scholar 

  7. Kerman, J.: Using random variable objects to compute probability simulations. Technical Report, Department of Statistics, Columbia University (2005)

  8. Lunn, D.J., Thomas, A., Best, N., Spiegelhalter, D.: WinBUGS—a Bayesian modelling framework: concepts, structure, and extensibility. Stat. Comput. 10, 325–337 (2000)

    Article  Google Scholar 

  9. Oldford, R.W.: The Quail project: a current overview. Invited paper, 30th Symposium on the Interface, Minneapolis (1998). http://www.stats.uwaterloo.ca/~rwoldfor/papers/Interface1998/paper.pdf

  10. R Development Core Team: R: A Language and Environment for Statistical Computing. R Foundation for Statistical Computing, Vienna (2004)

    Google Scholar 

  11. Tierney, L.: LISP-STAT: An Object-Oriented Environment for Statistical Computing and Dynamic Graphics. Wiley, New York (1990)

    Google Scholar 

  12. Sturtz, S., Ligges, U., Gelman, A.: R2WinBUGS: a package for running WinBUGS from R. J. Stat. Softw. 12(3), 1–16 (2005). ISSN 1548-7660

    Google Scholar 

Download references

Author information

Affiliations

Authors

Corresponding author

Correspondence to Jouni Kerman.

Rights and permissions

Reprints and Permissions

About this article

Cite this article

Kerman, J., Gelman, A. Manipulating and summarizing posterior simulations using random variable objects. Stat Comput 17, 235–244 (2007). https://doi.org/10.1007/s11222-007-9020-4

Download citation

Keywords

  • Bayesian inference
  • Bayesian data analysis
  • Object-oriented programming
  • Posterior simulation
  • Random variable objects