Skip to main content

ximinf

Simulation-Based Inference of Cosmological Parameters in JAX using Type Ia Supernovae.

ximinf is a Python package for performing simulation-based inference (SBI) on cosmological parameters using type Ia supernova (SN Ia) data, built on top of JAX for fast, differentiable, and GPU/TPU-accelerated computation.

PyPI Documentation License: GPL v3

Installation

pip install ximinf

Requires Python >= 3.10.

Quickstart

import ximinf

See the documentation for full usage examples covering simulation, training, and inference.

Features

ximinf is organized into five core modules:

  • ximinf.generate_sim — Generates simulated SN Ia datasets. Includes Latin Hypercube Sampling (LHS) of cosmological/nuisance parameters under configurable priors (uniform, gaussian, half-gaussian, log-uniform, exponential, etc.), and per-dataset simulation via skysurvey.
  • ximinf.selection_effects — Tools for injecting realistic observational selection effects (e.g. Malmquist bias) into simulated supernova samples via stochastic magnitude-limited detection.
  • ximinf.nn_train — Training utilities for the neural network classifiers used in the inference step, including loss/accuracy functions, training/validation loops with early stopping, and JAX device setup helpers.
  • ximinf.nn_test — Diagnostics for validating inference quality, notably TARP (Tests of Accuracy with Random Points) coverage statistics computed across parameter groups.
  • ximinf.nn_inference — Neural posterior/likelihood-ratio inference. Builds and runs BlackJAX NUTS samplers over grouped parameter blocks, combining trained neural network outputs with analytic log-priors.

Typical workflow

  1. Simulate — Draw parameter sets with generate_sim.scan_params and generate mock SN Ia samples with generate_sim.simulate_one.
  2. (Optional) Apply selection effects — Use selection_effects.apply_malmquist_bias to emulate realistic detection thresholds.
  3. Train — Train per-group neural classifiers on simulated data with nn_train.train_loop.
  4. Infer — Sample the posterior over cosmological parameters with nn_inference.sample_posterior / nn_inference.inference_loop, using a NUTS kernel built on the trained networks.
  5. Validate — Check calibration of the resulting posteriors with nn_test.compute_ecp_tarp_groups.

License

This project is licensed under the GNU General Public License v3.0 (GPLv3). See LICENSE for details.

Author

Adam Triguia.trigui@ip2i.in2p3.fr IP2I Lyon

Release files for ximinf 0.0.159

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

Source distribution (sdist)

Source distribution for ximinf 0.0.159
File Size Uploaded
ximinf-0.0.159.tar.gz 40.5 kB Details

Built distribution (wheel)

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

Total release size: 83.3 kB

Release files / ximinf-0.0.159.tar.gz

Download URL ximinf-0.0.159.tar.gz
Size 40.5 kB
Tags Source
SHA-256 checksum
How to use checksums
78e34f94525204e6dc6f552d3b964dd4773eefa4163e057b464777d2fdbc9966
BLAKE2b-256 checksum
How to use checksums
339169e39fe7d441d7f30169b69915db43f790fc208445ead6898216bd8e081f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.16

Release files / ximinf-0.0.159-py3-none-any.whl

Download URL ximinf-0.0.159-py3-none-any.whl
Size 42.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9414f916560cd3e80aa6a60922fcb6a4259cbbfe9dc02c40a05a783f89a69a67
BLAKE2b-256 checksum
How to use checksums
c760d3083de6acda49b43f69333f8624457c81c11362991054cc06e8b9e1c184
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.16

Release history Release notifications | RSS feed

This release

0.0.159 This release

2 release files

0.0.99

2 release files

0.0.96

2 release files

0.0.95

2 release files

0.0.94

2 release files

0.0.93

2 release files

0.0.92

2 release files

0.0.91

2 release files

0.0.90

2 release files

0.0.89

2 release files

0.0.88

2 release files

0.0.87

2 release files

0.0.86

2 release files

0.0.85

2 release files

0.0.84

2 release files

0.0.83

2 release files

0.0.82

2 release files

0.0.81

2 release files

0.0.80

2 release files

0.0.79

2 release files

0.0.78

2 release files

0.0.77

2 release files

0.0.76

2 release files

0.0.75

2 release files

0.0.74

2 release files

0.0.73

2 release files

0.0.72

2 release files

0.0.71

2 release files

0.0.70

2 release files

0.0.42

2 release files

0.0.41

2 release files

0.0.40

2 release files

0.0.39

2 release files

0.0.38

2 release files

0.0.37

2 release files

0.0.36

2 release files

0.0.35

2 release files

0.0.34

2 release files

0.0.33

2 release files

0.0.32

2 release files

0.0.31

2 release files

0.0.30

2 release files

0.0.29

2 release files

0.0.28

2 release files

0.0.27

2 release files

0.0.26

2 release files

0.0.25

2 release files

0.0.24

2 release files

0.0.23

2 release files

0.0.22

2 release files

0.0.21

2 release files

0.0.20

2 release files

0.0.19

2 release files

0.0.18

2 release files

0.0.17

2 release files

0.0.16

2 release files

0.0.15

2 release files

0.0.13

2 release files

0.0.12

2 release files

0.0.11

2 release files

0.0.10

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

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