SourceXtractorPlusPlus  0.13
Please provide a description of the project.
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 
28 namespace ModelFitting {
29 
53 
54 public:
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::log(1. + val) : -1. * m_u0 * std::log(1. - val);
63  }
64 
65 private:
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 
ModelFitting::LogChiSquareComparator::operator()
double operator()(double real, double model, double weight) const
Returns the modified residual.
Definition: LogChiSquareComparator.h:60
ModelFitting::LogChiSquareComparator
Data vs model comparator which computes a modified residual.
Definition: LogChiSquareComparator.h:52
std::log
T log(T... args)
ModelFitting::LogChiSquareComparator::LogChiSquareComparator
LogChiSquareComparator(double u0=10.)
Creates a new LogChiSquareComparator instance with the given .
Definition: LogChiSquareComparator.h:57
ModelFitting::LogChiSquareComparator::m_u0
double m_u0
Definition: LogChiSquareComparator.h:67
ModelFitting
Definition: AsinhChiSquareComparator.h:30