Parameters

class asymmetry.core.fitting.parameters.Parameter(name, value=0.0, min=-inf, max=inf, fixed=False, expr=None, link_group=None, tie=None)[source]

Bases: object

A single fit parameter.

name
value = 0.0
min = -inf
max = inf
fixed = False
expr = None
tie = None
property is_constrained[source]
__init__(name, value=0.0, min=-inf, max=inf, fixed=False, expr=None, link_group=None, tie=None)
class asymmetry.core.fitting.parameters.ParameterSet(params=None)[source]

Bases: object

Ordered collection of Parameter objects.

__init__(params=None)[source]
add(param)[source]
property free_parameters[source]
property names[source]

Return members of each equality link group, keyed by group id.

Singletons (a group with one member) are dropped — linking one parameter to nothing is a no-op.

Return the “main” parameter of a link group.

Mirrors WiMDA: the first member, unless a later member is free (non-fixed) — then the first free member is the main, so the free-fit set always contains the group main.

Map each non-main linked parameter name to its group main’s name.

tie_followers()[source]

Map each affinely-tied parameter name to its AffineTie.

These followers are derived from other parameters at fit time and so drop out of the free set (via Parameter.is_constrained).

values_array()[source]
update_values(values)[source]

Fit results

class asymmetry.core.fitting.engine.FitResult(success, objective, chi_squared=0.0, reduced_chi_squared=0.0, parameters=<factory>, uncertainties=<factory>, covariance=None, covariance_parameters=<factory>, residuals=None, residual_time=None, residual_sigma=None, message='', function_calls=0, gradient_calls=0, hessian_calls=0, edm=None, covariance_accurate=False, dof=0, minos_errors=None, parameter_history=None, warnings=<factory>, correction_metadata=<factory>, deadtime_calibration=None, minimum_expected_count=None, observation_report=None, input_attribution=None, computation_revision=None, spectral_residual_attribution=None)[source]

Container for the outcome of a fit.

Scale: residuals, and every asymmetry-valued entry of parameters / uncertainties (an A0, A, baseline), are on the scale of the data that was fitted — percent (0–100) for a MuonDataset and for the built-in models’ seeds. Nothing here rescales, so a fit run on fraction-scale arrays reports fraction-scale amplitudes. See “Asymmetry units across the API” in the documentation.

success
objective
chi_squared = 0.0
reduced_chi_squared = 0.0
parameters
uncertainties
covariance = None
covariance_parameters
residuals = None

data − model over the fitted window, on the data’s asymmetry scale.

residual_time = None
residual_sigma = None
message = ''
function_calls = 0
gradient_calls = 0
hessian_calls = 0
edm = None
covariance_accurate = False
dof = 0

Degrees of freedom ν = N_data − N_free for this (sub)fit. Used by the χ² quality verdict; 0 means “unknown” and callers fall back to inference.

minos_errors = None

Opt-in MINOS asymmetric 1σ intervals, {param: (lower, upper)} with lower < 0 < upper (iminuit’s signed offsets). None when MINOS was not requested or every scan failed. A display-only overlay — the symmetric HESSE uncertainties are unchanged and remain the value every downstream surface (trends, export, propagation, promote) consumes.

parameter_history = None
warnings

Fit warnings are both retained here and emitted through Python warnings.

correction_metadata
deadtime_calibration = None
minimum_expected_count = None

Minimum over the whole minimized objective, shared by coupled members.

observation_report = None
input_attribution = None
computation_revision = None
spectral_residual_attribution = None
__init__(success, objective, chi_squared=0.0, reduced_chi_squared=0.0, parameters=<factory>, uncertainties=<factory>, covariance=None, covariance_parameters=<factory>, residuals=None, residual_time=None, residual_sigma=None, message='', function_calls=0, gradient_calls=0, hessian_calls=0, edm=None, covariance_accurate=False, dof=0, minos_errors=None, parameter_history=None, warnings=<factory>, correction_metadata=<factory>, deadtime_calibration=None, minimum_expected_count=None, observation_report=None, input_attribution=None, computation_revision=None, spectral_residual_attribution=None)

Parameter carry

class asymmetry.core.fitting.parameter_carry.GroupAmplitude(components)[source]

A fraction group’s shared amplitude, keyed by the group’s component set.

The amplitude belongs to the group as a whole, so it only carries when every component of the group survives into the same group.

asymmetry.core.fitting.parameter_carry.carry_parameter_set(old_model, new_model, origins, parameters)[source]

Carry a ParameterSet onto new_model’s parameter names.

Value, bounds, fixed and link_group follow the component instance. Ties and expression constraints have their referenced names re-targeted through the same map and are dropped when a referenced parameter did not survive. Parameters with no predecessor are absent from the result.

Seeding

asymmetry.core.fitting.seeding.seed_parameters(model, context)[source]

Return a starting Seed for every parameter of model.

The layers are applied in the order documented at the top of this module; each one overrides the values of those before it.

asymmetry.core.fitting.seeding.seed_trend_parameters(model, x, y)[source]

Return a starting Seed for every parameter of a trend model.

Three layers, as for a fit model: static component defaults, then the series’ own scale (asymmetry.core.fitting.seeding._trend_scale_values — a baseline at the mean of y, a slope/amplitude at its span, a characteristic x at half the fitted range), then suggest_trend_seeds(), which is what makes a critical-temperature component converge without a hand reseed. A trend is fitted against a series rather than a run, so nothing here is run-bound.

class asymmetry.core.fitting.seeding.Seed(value, fixed=False, min=-inf, max=inf, run_bound=False)[source]

One parameter’s starting value, bounds, Fix state and provenance.

Parameters

class asymmetry.core.fitting.parameters.AffineTie(main, scale=1.0, offset=None, offset_scale=1.0, const=0.0)[source]

An affine constraint deriving a follower from other parameters.

follower = scale * main + offset_scale * offset + const

where main and the optional offset are parameter names. Unlike an equality link group (which can only force follower == main), this expresses offset / equal-spacing ties such as the symmetric muonium satellites f_lo = f_c - delta / f_hi = f_c + delta. The offset may reference a free auxiliary parameter (e.g. the half-splitting delta) that the model itself does not consume — it exists only to drive the ties, and is fitted with its own uncertainty.

This is a deliberate capability beyond WiMDA, which has no affine tie (see docs/porting/link-groups/). It is intentionally a linear map of at most two parameters plus a constant — enough for equal spacing, with a clean delta-method uncertainty — rather than a general expression evaluator.

asymmetry.core.fitting.parameters.PARAM_INFO_REGISTRY

Parameter symbols, units, and physical descriptions.

asymmetry.core.fitting.parameters.get_param_info(name)[source]

Return metadata for a parameter name, including indexed variants.