SourceXtractorPlusPlus 0.21
SourceXtractor++, the next generation SExtractor
Loading...
Searching...
No Matches
LogChiSquareComparator.h
Go to the documentation of this file.
1
23#ifndef MODELFITTING_LOGCHISQUARECOMPARATOR_H
24#define MODELFITTING_LOGCHISQUARECOMPARATOR_H
25
26#include <cmath>
27
28namespace ModelFitting {
29
53
54public:
55
57 LogChiSquareComparator(double u0=10.) : m_u0{u0} { }
58
60 double operator()(double real, double model, double weight) const {
61 double val = weight * (real - model) / m_u0;
62 return val>0. ? m_u0 * std::log1p(val) : -1. * m_u0 * std::log1p(-val);
63 }
64
65private:
66
67 double m_u0;
68
69}; // end of class LogChiSquareComparator
70
71} // end of namespace ModelFitting
72
73
74
75#endif /* MODELFITTING_LOGCHISQUARECOMPARATOR_H */
76
Data vs model comparator which computes a modified residual.
double operator()(double real, double model, double weight) const
Returns the modified residual.
LogChiSquareComparator(double u0=10.)
Creates a new LogChiSquareComparator instance with the given .
T log1p(T... args)