API Reference#

Configuration#

High-level configuration objects for assembling a calibration problem and handing it to an external sampler (emcee, dynesty, etc.).

rxmc.config.CalibrationConfig

End-to-end configuration for Bayesian calibration.

rxmc.config.ParameterConfig

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.

rxmc.priors.IndependentPrior

Independent prior built from an arbitrary list of scipy.stats distributions.

rxmc.priors.TruncatedNormalPrior

Independent truncated-normal prior for a vector of parameters.

Core building blocks#

rxmc.constraint.Constraint

Pair observations with a physical model and a likelihood model.

rxmc.evidence.Evidence

A collection of independent constraints sharing a common physical model.

rxmc.observation.Observation

A class to represent an observation with statistical errors, as well as systematic errors associated with a common normalization and offset of all or some of the data points of the the dependent variable y.

rxmc.observation.FixedCovarianceObservation

A class to represent an observation with fixed covariance.

rxmc.params.Parameter

A single scalar model parameter.

rxmc.physical_model.PhysicalModel

Abstract base class for parametric physical models.

rxmc.physical_model.Polynomial

Polynomial model of fixed order.

Likelihood models#

rxmc.likelihood_model.LikelihoodModel

A class to represent a likelihood model for comparing an Observation to a PhysicalModel.

rxmc.likelihood_model.FixedCovarianceLikelihood

A special LikelihoodModel to handle FixedCovarianceObservation objects, where the covariance matrix is fixed and does not depend on the parameters of the PhysicalModel.

rxmc.likelihood_model.Chi2LikelihoodModel

A LikelihoodModel that returns the negative half of the chi-squared statistic for the log likelihood, ignoring the log determinant term.

rxmc.likelihood_model.ParametricLikelihoodModel

A class to represent a likelihood model for comparing an Observation to a PhysicalModel, in which the LikelihoodModel has it's own parameters to calculate the covariance, aside from the parameters of the PhysicalModel.

rxmc.likelihood_model.UnknownNoiseErrorModel

A ParametricLikelihoodModel in which each data point in the observation has the same, unknown, statistical error, which is a parameter, $epsilon$.

rxmc.likelihood_model.UnknownNoiseFractionErrorModel

A ParametricLikelihoodModel in which each data point in the observation has the a statistical error corresponding to a fixed fraction of it's value, the fraction being a parameter, $epsilon$.

rxmc.likelihood_model.UnknownNormalizationModel

A ParametricLikelihoodModel in which the (log of the) multiplicative factor of the model output is a free parameter.

rxmc.likelihood_model.UnknownNormalizationErrorModel

A ParametricLikelihoodModel in which the systematic uncertainty of the normalization of the observation is a parameter, $eta$.

rxmc.likelihood_model.UnknownModelError

A ParametricLikelihoodModel in which the frac_err is a free parameter $gamma$, such that the covariance due to the uncorrelated model error takes the form:

rxmc.likelihood_model.StudentTLikelihoodModel

A LikelihoodModel that uses a Student's t-distribution for the likelihood.

rxmc.correlated_discrepancy_likelihood_model.SklearnKernelGPDiscrepancyModel

Parametric likelihood with a GP discrepancy covariance term.

Sampling#

rxmc.walker.Walker

Gibbs-style MCMC coordinator for a Bayesian calibration problem.

rxmc.param_sampling.Sampler

Base class wrapping a sampling algorithm with chain recording.

rxmc.param_sampling.MetropolisHastingsSampler

Metropolis-Hastings sampler with a fixed proposal distribution.

rxmc.param_sampling.AdaptiveMetropolisSampler

Metropolis sampler that adapts the proposal covariance with a sliding window.

rxmc.param_sampling.BatchedAdaptiveMetropolisSampler

Metropolis sampler that updates the proposal covariance after each batch.

rxmc.proposal.ProposalDistribution

Abstract base class for Metropolis-Hastings proposal distributions.

rxmc.proposal.NormalProposalDistribution

Multivariate-normal proposal centred at the current state.

rxmc.proposal.HalfNormalProposalDistribution

Half-normal proposal, useful for strictly non-negative parameters.

rxmc.proposal.LogspaceNormalProposalDistribution

Normal proposal operating in log space, for strictly positive parameters.

Sampling algorithms#

Low-level sampling functions used internally by the sampler classes.

rxmc.metropolis_hastings.metropolis_hastings

Metropolis-Hastings MCMC sampling.

rxmc.adaptive_metropolis.adaptive_metropolis

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.

rxmc.elastic_diffxs_observation.ElasticDifferentialXSObservation

Observation for elastic differential cross sections.

rxmc.elastic_diffxs_model.ElasticDifferentialXSModel

A model that predicts the elastic differential xs for a given reaction.

rxmc.ias_pn_observation.IsobaricAnalogPNObservation

Observation for (p,n) isobaric analog state (IAS) reactions.

rxmc.ias_pn_model.IsobaricAnalogPNXSModel

A model that predicts the (p,n) IAS differential xs for a given reaction.