starling.structure.bme_utils.BMEResult

class BMEResult[source]

Bases: object

Container for BME optimization results.

Methods

__init__

diagnostics

Diagnose BME reweighting results and identify potential issues.

print_diagnostics

Print a formatted diagnostic report for this BME result.

Attributes

kl_divergence

returns the KL divergence (relative entropy) from phi.

weights

initial_weights

lambdas

chi_squared_initial

chi_squared_final

phi

n_iterations

success

message

theta

observables

calculated_values

metadata

weights: ndarray
initial_weights: ndarray
lambdas: ndarray
chi_squared_initial: float
chi_squared_final: float
phi: float
n_iterations: int
success: bool
message: str
theta: float
observables: List[ExperimentalObservable]
calculated_values: ndarray
metadata: dict
property kl_divergence: float

returns the KL divergence (relative entropy) from phi.

diagnostics(warn_threshold: float = 0.5) dict[source]

Diagnose BME reweighting results and identify potential issues.

Returns:

Dictionary containing diagnostic information and warnings.

Return type:

dict

Notes

We report two notions of effective sample size:

  • neff_entropy (N_eff^(S)): entropy-based, derived from Φ = exp(-D_KL). This is the standard BME measure: N_eff^(S) = N * Φ.

  • neff_renyi2 (N_eff^(2)): 1 / sum_i w_i^2 (Rényi-2 / participation ratio). This is more sensitive to a few large weights, so it is always <= neff_entropy for the same weights.

print_diagnostics(warn_threshold: float = 0.5)[source]

Print a formatted diagnostic report for this BME result.

__init__(weights: ndarray, initial_weights: ndarray, lambdas: ndarray, chi_squared_initial: float, chi_squared_final: float, phi: float, n_iterations: int, success: bool, message: str, theta: float, observables: List[ExperimentalObservable], calculated_values: ndarray, metadata: dict) None