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:
objectA single fit parameter.
- name
- value = 0.0
- min = -inf
- max = inf
- fixed = False
- expr = None
- link_group = None
- tie = None
- __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:
objectOrdered collection of
Parameterobjects.- link_groups()[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.
- link_main(group)[source]
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.
- 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).
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 ofparameters/uncertainties(anA0,A,baseline), are on the scale of the data that was fitted — percent (0–100) for aMuonDatasetand 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 − modelover 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)}withlower < 0 < upper(iminuit’s signed offsets).Nonewhen MINOS was not requested or every scan failed. A display-only overlay — the symmetric HESSEuncertaintiesare 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
ParameterSetontonew_model’s parameter names.Value, bounds,
fixedandlink_groupfollow 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
Seedfor 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
Seedfor 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 ofy, a slope/amplitude at its span, a characteristic x at half the fitted range), thensuggest_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.
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 + constwhere
mainand the optionaloffsetare parameter names. Unlike an equality link group (which can only forcefollower == main), this expresses offset / equal-spacing ties such as the symmetric muonium satellitesf_lo = f_c - delta/f_hi = f_c + delta. Theoffsetmay reference a free auxiliary parameter (e.g. the half-splittingdelta) 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.