SamplesKDEPrior#
- class gammapy.modeling.models.SamplesKDEPrior[source]#
Bases:
PriorPrior based on a Gaussian kernel density estimate (KDE) constructed from (optionally weighted) samples.
- Parameters:
- samples
ndarray One-dimensional samples used to build the KDE. Shape
(n_samples,)or any array that can be flattened to this shape.- weights
ndarray, optional Weights associated with the samples. Must have the same length as
samples. If not given, all samples are assigned equal weight. Weights are normalised internally to sum to 1.
- samples
Attributes Summary
Methods Summary
evaluate(value)Evaluate the prior contribution to the fit statistic.
from_dict(data)Create prior from dictionary.
to_dict()Convert prior to dictionary for YAML serialization.
Attributes Documentation
- default_parameters = <gammapy.modeling.parameter.PriorParameters object>#
- tag = ['SamplesKDEPrior']#
Methods Documentation
- evaluate(value)[source]#
Evaluate the prior contribution to the fit statistic.
This returns
-2 log p(value)wherepis given by the KDE.
- classmethod __new__(*args, **kwargs)#