Skip to main content Accessibility help
×
Hostname: page-component-848d4c4894-pjpqr Total loading time: 0 Render date: 2024-06-20T13:32:12.142Z Has data issue: false hasContentIssue false

2 - Prerequisites

Published online by Cambridge University Press:  11 May 2017

Joseph M. Hilbe
Affiliation:
Jet Propulsion Laboratory, California Institute of Technology
Rafael S. de Souza
Affiliation:
Eötvös Loránd University, Budapest
Emille E. O. Ishida
Affiliation:
Université Clermont-Auvergne (Université Blaise Pascal), France
Get access

Summary

Software

The subtitle of this book is “using R, JAGS, Python, and Stan.” These software packages are used by astronomers more than any other Bayesian modeling software. Other packages are commonly used by those in other disciplines, e.g., WinBUGS, OpenBUGS, MLwiN, Minitab, SAS, SPSS, and recently, Stata. Minitab, SAS, SPSS, and Stata are general commercial statistical packages. WinBUGS is no longer being supported, future development being given to OpenBUGS. It is freeware, as are R, JAGS, Python, and Stan. MLwiN provides hierarchical and Bayesian hierarchical modeling capabilities and is free for academics.

In this chapter we provide an overview of each package discussed in this text. JAGS and Stan can be run within the R or Python environment. Most scripts discussed in this book use JAGS from within R and Stan from within Python. It is important, however, to state that this is merely a presentation choice and that the alternative combination (Stan from R and JAGS from Python) is also possible. We chose the first combination for didactic reasons, as an opportunity for the interested reader to familiarize themself with a second programming language. In two different contexts (Chapters 8 and 10)we also show how Stan can be used from within R.

The R environment has become the most popular all purpose statistical software worldwide. Many statistical departments require their graduate students to learn R before gaining an advanced degree. Python, however, has quickly been gaining adherents. It is a powerful and user-friendly tool for software development but does not have nearly as many already supported procedures as R.

Astronomers are pretty much split between using R and Python for the statistical analysis of their study data. Each software package has its own advantage. R can be used by itself for a large range of statistical modeling tasks, but until recently its Bayesian capability has been limited to relatively simple models. It is certainly possible, however, for more complex Bayesian models to be written in R, but for the most part R has been used as a framework within which specific Bayesian packages are run, e.g., JAGS, INLA, bmsr, and even Stan. Bayesian astronomers nearly always turn to JAGS or Python for executing complex models. Stan is a new tool that is quickly gaining popularity.

Type
Chapter
Information
Bayesian Models for Astrophysical Data
Using R, JAGS, Python, and Stan
, pp. 9 - 22
Publisher: Cambridge University Press
Print publication year: 2017

Access options

Get access to the full version of this content by using one of the access options below. (Log in options will check for institutional or personal access. Content may require purchase if you do not have access.)

References

Andreon, S. and B., Weaver (2015). Bayesian Methods for the Physical Sciences: Learning from Examples in Astronomy and Physics. Springer Series in Astrostatistics. Springer.
Betancourt, M. (2016). “Some Bayesian modeling techniques in Stan.” www.youtube.com/watch?v=uSjsJg8fcwY (visited on 06/18/2016).
Chattopadhyay, A. K. and T., Chattopadhyay (2014). Statistical Methods for Astronomical Data Analysis. Springer Series in Astrostatistics. Springer.
Gelman, A., J., Carlin, H., Stern, D., Dunson, A., Vehtari, and D., Rubin (2013). Bayesian Data Analysis, Third Edition. Chapman & Hall/CRC Texts in Statistical Science. Taylor & Francis.
Gelman, A., D., Lee, and J., Guo (2015). “Stan: a probabilistic programming language for Bayesian inference and optimization.” J. Educational and Behavioral Statistics.Google Scholar
Ivezić, Z. et al. (2014). Statistics, Data Mining, and Machine Learning in Astronomy: A Practical Python Guide for the Analysis of Survey Data. EBSCO ebook academic collection. Princeton University Press.
Korner-Nievergelt, F. et al. (2015). Bayesian Data Analysis in Ecology Using Linear Models with R, BUGS, and Stan. Elsevier Science.
Kruschke, J. (2010). Doing Bayesian Data Analysis: A Tutorial Introduction with R. Elsevier Science.
Lunn, D. et al. (2012). The BUGS Book: A Practical Introduction to Bayesian Analysis. Chapman & Hall/CRC Texts in Statistical Science. Taylor & Francis.
McElreath, R. (2016). Statistical Rethinking: A Bayesian Course with Examples in R and Stan. Chapman & Hall/CRC Texts in Statistical Science. CRC Press.
Muenchen, R. A. and J. M., Hilbe (2010). R for Stata Users. Statistics and Computing. Springer.
Teetor, P. (2011). R Cookbook. O'Reilly Media.
Zuur, A. F., J. M., Hilbe, and E. N., Ieno (2013). A Beginner's Guide to GLM and GLMM with R: A Frequentist and Bayesian Perspective for Ecologists. Highland Statistics.

Save book to Kindle

To save this book to your Kindle, first ensure coreplatform@cambridge.org is added to your Approved Personal Document E-mail List under your Personal Document Settings on the Manage Your Content and Devices page of your Amazon account. Then enter the ‘name’ part of your Kindle email address below. Find out more about saving to your Kindle.

Note you can select to save to either the @free.kindle.com or @kindle.com variations. ‘@free.kindle.com’ emails are free but can only be saved to your device when it is connected to wi-fi. ‘@kindle.com’ emails can be delivered even when you are not connected to wi-fi, but note that service fees apply.

Find out more about the Kindle Personal Document Service.

Available formats
×

Save book to Dropbox

To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Dropbox.

Available formats
×

Save book to Google Drive

To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Google Drive.

Available formats
×