SourceXtractorPlusPlus
0.21
SourceXtractor++, the next generation SExtractor
Loading...
Searching...
No Matches
ModelFitting
ModelFitting
Engine
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
52
class
LogChiSquareComparator
{
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::log1p
(
val
) : -1. *
m_u0
*
std::log1p
(-
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
Data vs model comparator which computes a modified residual.
Definition
LogChiSquareComparator.h:52
ModelFitting::LogChiSquareComparator::operator()
double operator()(double real, double model, double weight) const
Returns the modified residual.
Definition
LogChiSquareComparator.h:60
ModelFitting::LogChiSquareComparator::m_u0
double m_u0
Definition
LogChiSquareComparator.h:67
ModelFitting::LogChiSquareComparator::LogChiSquareComparator
LogChiSquareComparator(double u0=10.)
Creates a new LogChiSquareComparator instance with the given .
Definition
LogChiSquareComparator.h:57
std::function
std::log1p
T log1p(T... args)
ModelFitting
Definition
AsinhChiSquareComparator.h:30
Generated by
1.10.0