Skip to content

Releases

v0.1.0: First release

Choose a tag to compare

@mirkobunse mirkobunse released this 03 Nov 09:17

caife is a Python package for unfolding: the reconstruction of a target distribution, like an energy spectrum, from indirect and smeared observations. Its name stands for Composable and Auto-differentiable Inversion of Fredholm Equations.

pip install caife

The package is in an early stage of development (alpha). Its API might change in future 0.x releases.

What caife offers

  • Models of the measurement process: LinearCountModel for a single target quantity and MultiTargetModel for joint, multi-dimensional target spectra, e.g., over energy and zenith angle. Their counterparts LinearSystematicsCountModel and MultiTargetSystematicsModel fit systematic parameters of the detector jointly with the spectrum. All models can account for a background distribution.
  • Representations of the observed features: UnivariateBinning, GridBinning, TreeBinning (data-driven bins from a decision tree), and GridSearchRepresentation for tuning the hyper-parameters of a representation.
  • Freely definable losses: you write the negative log-likelihood of your analysis with JAX, e.g., from poisson_nll and tikhonov_regularization, which can penalize deviations from polynomials of any order. caife differentiates it automatically.
  • Robust fits: ScipySolver minimizes your loss with second-order optimization, starting from several random points. Only solutions with a positive definite Hessian count as valid. Latent parameterizations guarantee positive spectra with the observed total number of events and keep systematic parameters within their simulated range.
  • Uncertainties: uncertainty_from_aux samples around the solution in the latent space, so that the asymmetric ±1 sigma intervals respect all constraints, including the regularization and the fitted systematics.
  • Choosing the regularization strength: gcc_from_aux and pcs_from_aux compute global correlation coefficients and pair-wise correlation scores of the fitted parameters, marginalizing nuisance parameters like overflow bins and systematics.
  • Toy data and examples: caife.examples generates simulated data with a known truth, which the notebooks examples/quickstart.ipynb and examples/systematics.ipynb use to walk through complete analyses.

Getting started

caife requires Python 3.9 or later and depends on JAX (version 0.4.25 or later). A GPU-powered JAX backend is optional.

caife is licensed under the GNU Lesser General Public License, version 2.1 only (LGPL-2.1-only).