Package: bxa
About Bayesian X-ray Analysis (BXA)BXA connects the X-ray spectral analysis environments Xspec/Sherpa
to the nested sampling algorithm UltraNest
forBayesian Parameter EstimationandModel comparison.BXA provides the following features:parameter estimation in arbitrary dimensions, which involves:finding the best fitcomputing error barscomputing marginal probability distributionsparallelisation with MPIplotting of spectral model vs. the data:for the best fitfor each of the solutions (posterior samples)for each componentmodel selection:computing the evidence for the considered model,
ready for use in Bayes factorsunlike likelihood-ratios, not limited to nested modelsmodel discovery:visualize deviations between model and data with Quantile-Quantile (QQ) plots.
QQ-plots do not require binning and are more comprehensive than residuals.
This will give you ideas on when to introduce more complex models, which
may again be tested with model selectionBXA shines especiallywhen systematically analysing a large data-set, orwhen comparing multiple modelswhen analysing low counts data-set with realistic modelsbecause its robust and unsupervised fitting algorithm explores
even complicated parameter spaces in an automated fashion.
The user does not need to initialise to good starting points.
Thealgorithmautomatically runs until convergence, and slows down to sample
carefully if complicated parameter spaces are encountered. This allows building automated analysis pipelines.Who is using BXA?Dr. Antonis Georgakakis, Dr. Angel Ruiz (NOA, Athens)Dr. Mike Anderson (MPA, Munich)Dr. Franz Bauer, Charlotte Simmonds (PUC, Jonathan Quirola Vásquez, Santiago)Dr. Stéphane Paltani, Dr. Carlo Ferrigno (ISDC, Geneva)Dr. Zhu Liu (NAO, Beijing)Dr. Georgios Vasilopoulos (Yale, New Haven)Dr. Francesca Civano, Dr. Aneta Siemiginowska (CfA/SAO, Cambridge)Dr. Teng Liu, Adam Malyali, Riccardo Arcodia, Sophia Waddell, Torben Simm, … (MPE, Garching)Dr. Sibasish Laha, Dr. Alex Markowitz (UCSD, San Diego)Dr. Arash Bahramian (Curtin University, Perth)Dr. Peter Boorman (U of Southampton, Southampton; ASU, Prague)andyou?DocumentationBXA’sdocumentationis hosted athttp://johannesbuchner.github.io/BXA/InstallationFirst, you need to have eitherSherpaorXspecinstalled and its environment loaded.BXA itself can installed easily using pip or conda:$ pip install bxaIf you want to install in your home directory, install with:$ pip install bxa --userThe following commands should not yield any error message:$ python -c 'import ultranest'
$ python -c 'import xspec'
$ sherpaYou may need to install python and some basic packages through your package manager. For example:$ yum install ipython python-matplotlib scipy numpy matplotlib
$ apt-get install python-numpy python-scipy python-matplotlib ipythonBXA requires the following python packages: requests corner astropy h5py cython scipy tqdm.
They should be downloaded automatically. If they are not, install them
also with pip/conda.The source code is available fromhttps://github.com/JohannesBuchner/BXA,
so alternatively you can download and install it:$ git clone https://github.com/JohannesBuchner/BXA
$ cd BXA
$ python setup.py installOr if you only want to install it for the current user:$ python setup.py install --userSupported operating systems:
BXA runs on all operating systems supported byciao/sherpaorheasoft/xspec.
The support is systematically tested for every BXA release byTravis CI, but only for Ubuntu Linux.RunningInSherpa, load the package:jbuchner@ds42 ~ $ sherpa
-----------------------------------------------------
Welcome to Sherpa: CXC's Modeling and Fitting Package
-----------------------------------------------------
CIAO 4.4 Sherpa version 2 Tuesday, June 5, 2012

sherpa-1> import bxa.sherpa as bxa
sherpa-2> bxa.BXASolver?ForXspec, start python or ipython:jbuchner@ds42 ~ $ ipython
In [1]: import xspec

In [2]: import bxa.xspec as bxa

In [3]: bxa.BXASolver?Now you can use BXA. See the documentation pages for how
to perform analyses. Several examples are included.CodeSee thecode repository pageCiting BXA correctlyRefer to theaccompaning paper Buchner et al. (2014)which gives introduction and
detailed discussion on the methodology and its statistical footing.We suggest giving credit to the developers of Sherpa/Xspec, UltraNest and of this software.
As an example:For analysing X-ray spectra, we use the analysis software BXA (\ref{Buchner2014}),
which connects the nested sampling algorithm UltraNest (\ref{ultranest})
with the fitting environment CIAO/Sherpa (\ref{Fruscione2006}).Where the BibTex entries are:for BXA and the contributions to X-ray spectral analysis methodology (model comparison, model discovery, Experiment design, Model discovery through QQ-plots):Buchner et al. (2014) A&AThe paper is available atarXiv:1402.0004bibtex entryfor UltraNest: seehttps://johannesbuchner.github.io/UltraNest/issues.html#how-should-i-cite-ultranestfor Sherpa: seeSherpafor Xspec: seeXspec