Parameter¶
-
class
gammapy.modeling.
Parameter
(name, value, unit='', scale=1, min=nan, max=nan, frozen=False, error=0)[source]¶ Bases:
object
A 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
,quantity
ormin
andmax
properties and consider the fact that there is afactor`
andscale
an 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_min
andfactor_max
properties, i.e. the optimiser “sees” the well-scaled problem.- Parameters
Attributes Summary
Factor (float).
Factor max (float).
Factor min (float).
Frozen? (used in fitting) (bool).
Maximum (float).
Minimum (float).
Name (str).
Value times unit (
Quantity
).Scale (float).
Unit (
Unit
).Value = factor x scale (float).
Methods Summary
autoscale
(self[, method])Autoscale the parameters.
copy
(self)A deep copy
to_dict
(self)Convert to dict.
Attributes Documentation
-
error
¶
-
factor
¶ Factor (float).
-
factor_max
¶ Factor max (float).
This
factor_max = max / scale
is for the optimizer interface.
-
factor_min
¶ Factor min (float).
This
factor_min = min / scale
is 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
factor
andscale
according tomethod
Available methods:
scale10
setsscale
to power of 10, so that abs(factor) is in the range 1 to 10factor1
setsfactor, scale = 1, value
In both cases the sign of value is stored in
factor
, i.e. thescale
is always positive.- Parameters
- method{‘factor1’, ‘scale10’}
Method to apply