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.
Similar content being viewed by others
Explore related subjects
Discover the latest articles, news and stories from top researchers in related subjects.References
Chib, S.: Marginal likelihood from the Gibbs output. J. Am. Stat. Assoc. 90, 1313–1321 (1995)
Chib, S., Jeliazkov, I.: Marginal likelihood from the Metropolis-Hastings output. J. Am. Stat. Assoc. 96, 270–281 (2001)
Gelfand, A.E., Smith, A.F.M.: Sampling-based approaches to calculating marginal densities. J. Am. Stat. Assoc. 94, 247–253 (1990)
Gelman, A., Carlin, J.B., Stern, H.S., Rubin, D.B.: Bayesian Data Analysis, 2nd edn. Chapman & Hall/CRC, London (2003)
Gelman, A., King, G.: A unified model for evaluating electoral systems and redistricting plans. Am. J. Political Sci. 38, 514–554 (1994)
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)
Kerman, J.: Using random variable objects to compute probability simulations. Technical Report, Department of Statistics, Columbia University (2005)
Lunn, D.J., Thomas, A., Best, N., Spiegelhalter, D.: WinBUGS—a Bayesian modelling framework: concepts, structure, and extensibility. Stat. Comput. 10, 325–337 (2000)
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
R Development Core Team: R: A Language and Environment for Statistical Computing. R Foundation for Statistical Computing, Vienna (2004)
Tierney, L.: LISP-STAT: An Object-Oriented Environment for Statistical Computing and Dynamic Graphics. Wiley, New York (1990)
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
Author information
Authors and Affiliations
Corresponding author
Rights 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
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s11222-007-9020-4