API Reference#
Configuration#
High-level configuration objects for assembling a calibration problem and handing it to an external sampler (emcee, dynesty, etc.).
End-to-end configuration for Bayesian calibration. |
|
Configuration for a single sector of parameters. |
Priors#
Prior distribution classes that satisfy the generic prior protocol required by
ParameterConfig. Any user-defined class with logpdf,
rvs, and (optionally) prior_transform methods can be used directly.
Independent prior built from an arbitrary list of |
|
Independent truncated-normal prior for a vector of parameters. |
Core building blocks#
Pair observations with a physical model and a stacked covariance. |
|
A collection of independent constraints sharing a common physical model. |
|
Experimental data: |
|
A single scalar model parameter. |
|
Abstract base class for parametric physical models. |
|
Polynomial model of fixed order. |
Transforms#
One low-level, numpy-style transform type shared by observations (the
comparison space, e.g. transform=log), models (parametric transforms such
as a latent normalisation) and covariance terms (coordinate transforms).
A numpy-style transform with optional parameters. |
|
Coerce |
|
A numpy-style transform with optional parameters. |
|
Natural log; |
|
A numpy-style transform with optional parameters. |
|
A latent multiplicative normalisation \(\rho\, y\). |
|
One latent normalisation \(\rho_i\) per dataset, routed by identity. |
Covariance terms#
The stacked covariance of a Constraint is assembled
additively from Term objects — a single generic type:
a numpy-style callable of a TermContext (the term’s
local x/y/ym) and its parameters, plus a kind
("diag"/"mode"/"matrix"). The factory helpers build the common
terms in one line; anything else is a direct Term(fn, params, kind=...).
A StackContext bundles the stacked x/y/ym
that a ConstraintCovariance is evaluated on.
One additive contribution to the stacked covariance. |
|
A term's local view of the stack on its own support. |
|
Always-on, genuinely uncorrelated statistical diagonal |
|
A correlated normalisation systematic |
|
A correlated absolute-offset systematic |
|
Unknown statistical noise |
|
Unknown fractional noise |
|
Unknown uncorrelated model error |
|
A correlated mode |
|
A Gaussian-process kernel |
|
Constant unit basis. |
|
The model prediction — the prediction-scaled basis. |
|
|
|
Basis |
|
Parametric basis |
|
Kernel amplitude |
|
Kernel amplitude |
|
One contiguous index array per observation, in stacking order. |
|
The stacked covariance of a constraint, assembled from |
|
Bundle of stacked arrays passed to every |
Likelihood functionals#
Thin functionals of the pre-computed Mahalanobis statistics
(d2, logdet, n); all covariance modeling lives on the
ConstraintCovariance.
A functional of the pre-computed Mahalanobis statistics |
|
Multivariate-normal likelihood over the stacked residual. |
|
Multivariate Student-t likelihood with a degrees-of-freedom parameter. |
|
Generalised chi-squared functional — drops the log-det normalisation. |
|
Squared Mahalanobis distance and log-determinant via Cholesky factorisation. |
|
Multivariate-normal log likelihood from pre-computed statistics. |
Predictive utilities#
Posterior-predictive helpers, including Gaussian-process discrepancy propagation.
Percentile band over a matrix of predictive draws. |
|
Posterior mean and covariance of a GP discrepancy at |
|
Data-space predictive band that propagates total uncertainty. |
Model comparison#
Sampler-agnostic posterior-predictive checks, held-out scoring, and nested-sampling evidence bookkeeping.
Posterior-predictive draws on the constraint's active points. |
|
Empirical coverage of central predictive intervals at each nominal level. |
|
|
|
Per-point width of a central predictive interval. |
|
|
|
|
|
Replicate-aware evidence summary. |
|
|
|
Comparison-space log-Jacobian of a constraint (sum over active points). |
|
Split flat sampler rows into |
Sampling#
Gibbs-style MCMC coordinator for a Bayesian calibration problem. |
|
Base class wrapping a sampling algorithm with chain recording. |
|
Metropolis-Hastings sampler with a fixed proposal distribution. |
|
Metropolis sampler that adapts the proposal covariance with a sliding window. |
|
Metropolis sampler that updates the proposal covariance after each batch. |
|
Abstract base class for Metropolis-Hastings proposal distributions. |
|
Multivariate-normal proposal centred at the current state. |
|
Half-normal proposal, useful for strictly non-negative parameters. |
|
Normal proposal operating in log space, for strictly positive parameters. |
Sampling algorithms#
Low-level sampling functions used internally by the sampler classes.
Metropolis-Hastings MCMC sampling. |
|
Adaptive Metropolis algorithm with sliding-window covariance adaptation. |
Domain-specific models#
Reaction-physics observation and model classes for elastic differential cross sections and isobaric-analog (p,n) cross sections.
|
Observation for elastic differential cross sections. |
Momentum transfer \(q = 2k\sin(\theta/2)\) (fm^-1) on the data angles. |
|
A model that predicts the elastic differential xs for a given reaction. |
|
Observation for (p,n) isobaric analog state (IAS) reactions. |
|
A model that predicts the (p,n) IAS differential xs for a given reaction. |