Parameter¶
-
class
gammapy.modeling.Parameter(name, factor, unit='', scale=1, min=nan, max=nan, frozen=False)[source]¶ Bases:
objectA model parameter.
Note that the parameter value has been split into a factor and scale like this:
value = factor x scale
Users should interact with the
value,quantityorminandmaxproperties and consider the fact that there is afactor`andscalean implementation detail.That was introduced for numerical stability in parameter and error estimation methods, only in the Gammapy optimiser interface do we interact with the
factor,factor_minandfactor_maxproperties, i.e. the optimiser “sees” the well-scaled problem.Parameters: - name : str
Name
- factor : float or
Quantity Factor
- scale : float, optional
Scale (sometimes used in fitting)
- unit :
Unitor str, optional Unit
- min : float, optional
Minimum (sometimes used in fitting)
- max : float, optional
Maximum (sometimes used in fitting)
- frozen : bool, optional
Frozen? (used in fitting)
Attributes Summary
factorFactor (float). factor_maxFactor max (float). factor_minFactor min (float). frozenFrozen? (used in fitting) (bool). maxMaximum (float). minMinimum (float). nameName (str). quantityValue times unit ( Quantity).scaleScale (float). unitUnit ( Unit).valueValue = factor x scale (float). Methods Summary
autoscale(self[, method])Autoscale the parameters. to_dict(self)Convert to dict. Attributes Documentation
-
factor¶ Factor (float).
-
factor_max¶ Factor max (float).
This
factor_max = max / scaleis for the optimizer interface.
-
factor_min¶ Factor min (float).
This
factor_min = min / scaleis for the optimizer interface.
-
frozen¶ Frozen? (used in fitting) (bool).
-
max¶ Maximum (float).
-
min¶ Minimum (float).
-
name¶ Name (str).
-
scale¶ Scale (float).
-
value¶ Value = factor x scale (float).
Methods Documentation
-
autoscale(self, method='scale10')[source]¶ Autoscale the parameters.
Set
factorandscaleaccording tomethodAvailable methods:
scale10setsscaleto power of 10, so that abs(factor) is in the range 1 to 10factor1setsfactor, scale = 1, value
In both cases the sign of value is stored in
factor, i.e. thescaleis always positive.Parameters: - method : {‘factor1’, ‘scale10’}
Method to apply