jesterTOV.inference.likelihoods.rex.REXLikelihood#
- class REXLikelihood(experiment_name, posterior)[source]#
Bases:
LikelihoodBaseLikelihood function for PREX or CREX neutron skin measurements.
This likelihood constrains the symmetry energy parameters (E_sym, L_sym) using experimental measurements of neutron skin thickness from parity-violating electron scattering. The experimental data is represented as a kernel density estimate (KDE) of the posterior distribution in (E_sym, L_sym) parameter space, which is then evaluated for each candidate EOS.
The neutron skin thickness is primarily sensitive to the pressure of neutron matter at subsaturation densities, which is controlled by E_sym (symmetry energy at saturation) and L_sym (its density slope). These experiments provide complementary information to astrophysical mass-radius measurements, as they probe different density regimes and physical processes.
- Parameters:
experiment_name (str) – Name of the experiment providing the constraint. Must be either “PREX” (Lead Radius Experiment, Pb-208) or “CREX” (Calcium Radius Experiment, Ca-48). The two experiments probe different mass regions and have different systematic uncertainties.
posterior (Any) – Kernel density estimate of the experimental posterior distribution in (E_sym, L_sym) parameter space. This should be a callable object with a logpdf method that accepts a 2D array of shape (2, n_samples) and returns log-probability values. Typically constructed using scipy.stats.gaussian_kde or similar.
- Variables:
- Raises:
AssertionError – If experiment_name is not “PREX” or “CREX”
Notes
The likelihood evaluation extracts only the E_sym and L_sym parameters from the full parameter dictionary and evaluates the KDE at that point. Other nuclear parameters (K_sat, Q_sat, etc.) do not directly enter this likelihood, though they affect the overall EOS and may have indirect correlations.
The KDE is evaluated in log-space to avoid numerical underflow for low-probability regions and to match the log-likelihood framework used throughout the inference.
See also
ChiEFTLikelihoodLow-density constraints from chiral effective field theory
Examples
Create a PREX likelihood with a pre-computed KDE:
>>> from scipy.stats import gaussian_kde >>> import numpy as np >>> # Load PREX posterior samples (example) >>> samples = np.load("prex_samples.npy") # shape: (2, n_samples) for (E_sym, L_sym) >>> kde = gaussian_kde(samples) >>> from jesterTOV.inference.likelihoods import REXLikelihood >>> likelihood = REXLikelihood("PREX", kde) >>> params = {"E_sym": 32.0, "L_sym": 60.0} >>> log_like = likelihood.evaluate(params, data={})
Methods
__init__(experiment_name, posterior)evaluate(params)Evaluate the log-likelihood for PREX/CREX constraints.
Attributes
dataThe data for the likelihood.
modelThe model for the likelihood.
- evaluate(params)[source]#
Evaluate the log-likelihood for PREX/CREX constraints.
- Parameters:
params (dict[str, Float | Array]) – Dictionary containing EOS parameters. Required keys: - “E_sym” : Symmetry energy at saturation density (MeV) - “L_sym” : Slope of symmetry energy (MeV) Other parameters in the dict are ignored.
- Return type:
Float- Returns:
Float – Natural logarithm of the likelihood. This is the log-probability density of the (E_sym, L_sym) point under the experimental posterior KDE.
Notes
The method extracts E_sym and L_sym from the parameter dictionary, constructs a 2D array [E_sym, L_sym], and evaluates the KDE’s logpdf method. The result is a scalar log-probability suitable for combination with other log-likelihoods in the inference pipeline.