PriorParameter#
- class gammapy.modeling.PriorParameter(name, value, unit='', scale=1, min=nan, max=nan, error=0)[source]#
Bases:
Parameter
Attributes Summary
Confidence maximum value as a
float
.Confidence minimum value as a
float
.Factor as a float.
Factor maximum as a float.
Factor minimum as a float.
Frozen (used in fitting) (bool).
Maximum as a float.
Minimum as a float.
Name as a string.
Prior applied to the parameter as a
Prior
.Value times unit as a
Quantity
.Scale as a float.
Method used to set
factor
andscale
.Stat scan maximum.
Stat scan minimum.
Stat scan n sigma.
Stat scan values as a
ndarray
.Unit as a
Unit
object.Value = factor x scale (float).
Methods Summary
Autoscale the parameters.
Emit a warning or error if value is outside the minimum/maximum range.
copy
()Deep copy.
to_dict
()Convert to dictionary.
update_from_dict
(data)Update parameters from a dictionary.
Attributes Documentation
- conf_max#
Confidence maximum value as a
float
.Return parameter maximum if defined, otherwise return the scan_max.
- conf_min#
Confidence minimum value as a
float
.Return parameter minimum if defined, otherwise return the scan_min.
- error#
- factor#
Factor as a float.
- factor_max#
Factor maximum as a float.
This
factor_max = max / scale
is for the optimizer interface.
- factor_min#
Factor minimum as a float.
This
factor_min = min / scale
is for the optimizer interface.
- frozen#
Frozen (used in fitting) (bool).
- max#
Maximum as a float.
- min#
Minimum as a float.
- name#
Name as a string.
- scale#
Scale as a float.
- scale_method#
Method used to set
factor
andscale
.
- scan_max#
Stat scan maximum.
- scan_min#
Stat scan minimum.
- scan_n_sigma#
Stat scan n sigma.
- type#
- value#
Value = factor x scale (float).
Methods Documentation
- autoscale()#
Autoscale the parameters.
Set
factor
andscale
according toscale_method
attribute.Available
scale_method
.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. Ifscale_method
is None the scaling is ignored.
- check_limits()#
Emit a warning or error if value is outside the minimum/maximum range.
- copy()#
Deep copy.
- prior_stat_sum()#
- update_from_dict(data)#
Update parameters from a dictionary.