Skip to main content

About Bayesian X-ray Analysis (BXA)

BXA connects the X-ray spectral analysis environments Xspec/Sherpa to the nested sampling algorithm UltraNest for Bayesian Parameter Estimation and Model comparison.

BXA provides the following features:

  • parameter estimation in arbitrary dimensions, which involves:
    • finding the best fit

    • computing error bars

    • computing marginal probability distributions

    • parallelisation with MPI

  • plotting of spectral model vs. the data:
    • for the best fit

    • for each of the solutions (posterior samples)

    • for each component

  • model selection:
    • computing the evidence for the considered model, ready for use in Bayes factors

    • unlike likelihood-ratios, not limited to nested models

  • model 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 selection

BXA shines especially

  • when systematically analysing a large data-set, or

  • when comparing multiple models

  • when analysing low counts data-set with realistic models

because 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. The algorithm automatically runs until convergence, and slows down to sample carefully if complicated parameter spaces are encountered. This allows building automated analysis pipelines.

https://img.shields.io/pypi/v/BXA.svg https://coveralls.io/repos/github/JohannesBuchner/BXA/badge.svg Documentation Status Github repository

Contributors

  • David Kaltenbrunner @DaKalt

  • David Homan @dshoman

  • Ruiz Angel @ruizca

  • Liu Teng @lewtonstein

  • Carlo Ferrigno @ferrigno

  • Charlotte Simmonds

  • Brian Refsdal @brefsdal

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)

  • and you?

Documentation

BXA’s documentation is hosted at http://johannesbuchner.github.io/BXA/

Installation

First, you need to have either Sherpa or Xspec installed and its environment loaded.

BXA itself can installed easily using pip or conda:

$ pip install bxa

If you want to install in your home directory, install with:

$ pip install bxa --user

The following commands should not yield any error message:

$ python -c 'import ultranest'
$ python -c 'import xspec'
$ sherpa

You 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 ipython

BXA 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 from https://github.com/JohannesBuchner/BXA, so alternatively you can download and install it:

$ git clone https://github.com/JohannesBuchner/BXA
$ cd BXA
$ python setup.py install

Or if you only want to install it for the current user:

$ python setup.py install --user

Supported operating systems: BXA runs on all operating systems supported by ciao/sherpa or heasoft/xspec. The support is systematically tested for every BXA release by Travis CI, but only for Ubuntu Linux.

Running

In Sherpa, 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?

For Xspec, 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.

Code

See the code repository page

Citing BXA correctly

Refer to the accompaning 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:

Metadata

Release files for bxa 5.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bxa 5.1.1
File Size Uploaded
bxa-5.1.1.tar.gz 3.9 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for bxa 5.1.1
File Interpreter ABI Platform
bxa-5.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 8.0 MB

Release files / bxa-5.1.1.tar.gz

Download URL bxa-5.1.1.tar.gz
Size 3.9 MB
Tags Source
SHA-256 checksum
How to use checksums
4517274e746291fad920c1d31b165c47ef7cb6efa4bc36ab3f1a585d738cbf63
BLAKE2b-256 checksum
How to use checksums
482790fe711cf95b9f13afb9d02f1a8506e6f80f82eb2476e5602f3b48fe145f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.3

Release files / bxa-5.1.1-py3-none-any.whl

Download URL bxa-5.1.1-py3-none-any.whl
Size 4.0 MB
Tags Python 3
SHA-256 checksum
How to use checksums
b1d2b022be09f5ae2fa598b64cb6878ac37ce7a2646adeecd08a8777008394eb
BLAKE2b-256 checksum
How to use checksums
b2a7923b408b0ab11b96588c023c69f9d884bffee195eb90ba96a7a85c23f03a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.3

Release history Release notifications | RSS feed

This release

5.1.1 This release

2 release files

5.1.0

2 release files

5.0.0

2 release files

4.1.4

2 release files

4.1.3

2 release files

4.1.2

2 release files

4.1.1

2 release files

4.1.0

2 release files

4.0.7

2 release files

4.0.6

2 release files

4.0.5

3 release files

4.0.4

3 release files

4.0.3

3 release files

4.0.2

3 release files

4.0.1

3 release files

4.0.0

3 release files

3.4.2

3 release files

3.4.1

3 release files

3.4.0

3 release files

3.3.1

3 release files

3.3

3 release files

3.2

3 release files

3.1

3 release files

3.0

3 release files

2.10

3 release files

2.9

3 release files

2.8

3 release files

2.7

3 release files

2.5

4 release files

2.3

1 release file

2.2

2.1

1 release file

2.0

1 release file

1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page