20 :
Intensity(intensity), DataSample(datasample),
21 PhspDataSample(phspdatasample) {
23 LOG(INFO) <<
"MinLogLH::MinLogLH() | Size of data sample = " 32 double PhspIntegral(0.0);
33 double WeightSum(0.0);
35 auto IntensIter = Intensities.begin();
38 PhspIntegral += *x * *IntensIter;
63 std::pair<ComPWA::FunctionTree::FunctionTreeEstimator, FitParameterList>
69 <<
"createMinLogLHEstimatorFunctionTree(): constructing FunctionTree!";
71 if (0 == DataSample.
Weights.size()) {
72 LOG(ERROR) <<
"createMinLogLHEstimatorFunctionTree(): Data sample is " 73 "empty! Please supply some data.";
78 std::shared_ptr<ComPWA::FunctionTree::TreeNode> DataIntensityFunctionTree;
80 std::tie(DataIntensityFunctionTree, Parameters) =
86 auto weights = std::make_shared<Value<std::vector<double>>>(
89 std::shared_ptr<ComPWA::FunctionTree::TreeNode> EvaluationTree =
90 std::make_shared<ComPWA::FunctionTree::TreeNode>(
91 std::make_shared<Value<double>>(),
94 auto dataTree = std::make_shared<ComPWA::FunctionTree::TreeNode>(
95 std::make_shared<Value<double>>(),
98 auto Sum = std::make_shared<TreeNode>(
100 dataTree->addNode(Sum);
101 auto WeightedLogIntensities = std::make_shared<TreeNode>(
103 Sum->addNode(WeightedLogIntensities);
105 WeightedLogIntensities->addNode(
createLeaf(weights));
106 auto Log = std::make_shared<TreeNode>(
108 WeightedLogIntensities->addNode(Log);
109 Log->addNode(DataIntensityFunctionTree);
111 EvaluationTree->addNode(dataTree);
113 LOG(DEBUG) <<
"createMinLogLHEstimatorFunctionTree(): construction of LH " 114 "tree finished! Performing checks ...";
116 EvaluationTree->parameter();
117 LOG(DEBUG) <<
"createMinLogLHEstimatorFunctionTree(): finished!";
virtual void updateParametersFrom(const std::vector< double > &)=0
It is important to input the vector in the same length and order as defined in the getParameters() me...
double evaluate() noexcept final
Value of log likelihood function.
std::vector< FitParameter< double > > FitParameterList
std::vector< double > Weights
const Data::DataSet & PhspDataSample
std::tuple< std::shared_ptr< ComPWA::FunctionTree::TreeNode >, ComPWA::FunctionTree::ParameterList > bind(const ComPWA::DataMap &data)
std::vector< ComPWA::Parameter > getParameters() const final
virtual OutputType evaluate(const InputTypes &... args) noexcept=0
FitParameterList createFitParameterList(ComPWA::FunctionTree::ParameterList Parameters)
void updateParametersFrom(const std::vector< double > ¶ms) final
It is important to input the vector in the same length and order as defined in the getParameters() me...
const Data::DataSet & DataSample
std::pair< ComPWA::FunctionTree::FunctionTreeEstimator, FitParameterList > createMinLogLHFunctionTreeEstimator(ComPWA::FunctionTree::FunctionTreeIntensity &Intensity, const ComPWA::Data::DataSet &DataSample)
std::shared_ptr< TreeNode > createLeaf(std::shared_ptr< Parameter > parameter)
virtual std::vector< Parameter > getParameters() const =0
This class provides a list of parameters and values of different types.
Interface template for a general Function of the form OutputType Function(InputTypes) The concept clo...
Calculates the square root of input double values and double parameters.
MinLogLH(ComPWA::Intensity &intensity, const Data::DataSet &datasample, const Data::DataSet &phspdatasample)