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.164

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.164
File Size Uploaded
ximinf-0.0.164.tar.gz 40.5 kB Details

Built distribution (wheel)

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

Total release size: 83.4 kB

Release files / ximinf-0.0.164.tar.gz

Download URL ximinf-0.0.164.tar.gz
Size 40.5 kB
Tags Source
SHA-256 checksum
How to use checksums
8dbc902743311329f5a6101fe873dc3be4067d36d0f46c147dd90bc76a0e13af
BLAKE2b-256 checksum
How to use checksums
d22d23e76cef90b3c0fef4708f31bd962dd1e245193b052cd1a73c2c84def3ef
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.164-py3-none-any.whl

Download URL ximinf-0.0.164-py3-none-any.whl
Size 42.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a25317972e1b98cd3a8e044a72717f6a73452054629c001f4c66373f0b1de08b
BLAKE2b-256 checksum
How to use checksums
9fe15f906aa36ecf2d83366835634ee2e8726f1ae4eeb6435fd430c79cfe2598
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.164 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