Book contents
- Frontmatter
- Dedication
- Contents
- Preface
- 1 Astrostatistics
- 2 Prerequisites
- 3 Frequentist vs. Bayesian Methods
- 4 Normal Linear Models
- 5 GLMs Part I – Continuous and Binomial Models
- 6 GLMs Part II – Count Models
- 7 GLMs Part III – Zero-Inflated and Hurdle Models
- 8 Hierarchical GLMMs
- 9 Model Selection
- 10 Astronomical Applications
- 11 The Future of Astrostatistics
- Appendix A Bayesian Modeling using INLA
- Appendix B Count Models with Offsets
- Appendix C Predicted Values, Residuals, and Diagnostics
- References
- Index
- Plate section
- References
2 - Prerequisites
Published online by Cambridge University Press: 11 May 2017
- Frontmatter
- Dedication
- Contents
- Preface
- 1 Astrostatistics
- 2 Prerequisites
- 3 Frequentist vs. Bayesian Methods
- 4 Normal Linear Models
- 5 GLMs Part I – Continuous and Binomial Models
- 6 GLMs Part II – Count Models
- 7 GLMs Part III – Zero-Inflated and Hurdle Models
- 8 Hierarchical GLMMs
- 9 Model Selection
- 10 Astronomical Applications
- 11 The Future of Astrostatistics
- Appendix A Bayesian Modeling using INLA
- Appendix B Count Models with Offsets
- Appendix C Predicted Values, Residuals, and Diagnostics
- References
- Index
- Plate section
- References
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 DataUsing R, JAGS, Python, and Stan, pp. 9 - 22Publisher: Cambridge University PressPrint publication year: 2017