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.