BornAgain
1.19.79
Open-source research software to simulate and fit neutron and x-ray reflectometry and grazing-incidence small-angle scattering
|
Implementation of relative difference metric. With default L2 norm and weighting off corresponds to the formula.
where is the scattering vector magnitude. If weighting is on, coincides with the metric provided by Chi2Metric class.
Definition at line 191 of file ObjectiveMetric.h.
Public Member Functions | |
RQ4Metric () | |
RQ4Metric * | clone () const override |
double | compute (const SimDataPair &data_pair, bool use_weights) const override |
Computes metric value from SimDataPair object. Calls computeFromArrays internally. More... | |
double | computeFromArrays (std::vector< double > sim_data, std::vector< double > exp_data, std::vector< double > exp_stdv, std::vector< double > weight_factors) const override |
Computes metric value from data arrays. Negative values in exp_data are ignored as well as non-positive weight_factors and uncertainties. All arrays involved in the computation must be of the same size. More... | |
double | computeFromArrays (std::vector< double > sim_data, std::vector< double > exp_data, std::vector< double > weight_factors) const override |
Computes metric value from data arrays. Negative values in exp_data are ignored as well as non-positive weight_factors. All arrays involved in the computation must be of the same size. More... | |
auto | norm () const |
Returns a copy of the normalization function used. More... | |
void | setNorm (std::function< double(double)> norm) |
virtual void | transferToCPP () |
Used for Python overriding of clone (see swig/tweaks.py) More... | |
Private Attributes | |
std::function< double(double)> | m_norm |
RQ4Metric::RQ4Metric | ( | ) |
Definition at line 240 of file ObjectiveMetric.cpp.
|
overridevirtual |
Reimplemented from Chi2Metric.
Definition at line 245 of file ObjectiveMetric.cpp.
|
overridevirtual |
Computes metric value from SimDataPair object. Calls computeFromArrays internally.
data_pair | SimDataPair object. Can optionally contain data uncertainties |
use_weights | boolean, defines if data uncertainties should be taken into account |
Reimplemented from ObjectiveMetric.
Definition at line 250 of file ObjectiveMetric.cpp.
References ObjectiveMetric::compute(), Chi2Metric::computeFromArrays(), SimDataPair::experimentalData(), SimulationResult::flatVector(), RQ4, SimDataPair::simulationResult(), and SimDataPair::user_weights_array().
|
overridevirtualinherited |
Computes metric value from data arrays. Negative values in exp_data are ignored as well as non-positive weight_factors and uncertainties. All arrays involved in the computation must be of the same size.
sim_data | array with simulated intensities. |
exp_data | array with intensity values obtained from an experiment. |
exp_stdv | array with experimental data uncertainties. |
weight_factors | user-defined weighting factors. Used linearly, no matter which norm is chosen. |
Implements ObjectiveMetric.
Definition at line 96 of file ObjectiveMetric.cpp.
Referenced by compute().
|
overridevirtualinherited |
Computes metric value from data arrays. Negative values in exp_data are ignored as well as non-positive weight_factors. All arrays involved in the computation must be of the same size.
sim_data | array with simulated intensities. |
exp_data | array with intensity values obtained from an experiment. |
weight_factors | user-defined weighting factors. Used linearly, no matter which norm is chosen. |
Implements ObjectiveMetric.
Reimplemented in meanRelativeDifferenceMetric, and PoissonLikeMetric.
Definition at line 111 of file ObjectiveMetric.cpp.
References ObjectiveMetric::norm().
|
inlineinherited |
Returns a copy of the normalization function used.
Definition at line 67 of file ObjectiveMetric.h.
References ObjectiveMetric::m_norm.
Referenced by LogMetric::computeFromArrays(), Chi2Metric::computeFromArrays(), PoissonLikeMetric::computeFromArrays(), meanRelativeDifferenceMetric::computeFromArrays(), and ObjectiveMetric::setNorm().
|
inherited |
Definition at line 79 of file ObjectiveMetric.cpp.
References ObjectiveMetric::m_norm, and ObjectiveMetric::norm().
|
inlinevirtualinherited |
Used for Python overriding of clone (see swig/tweaks.py)
Definition at line 32 of file ICloneable.h.
|
privateinherited |
Definition at line 70 of file ObjectiveMetric.h.
Referenced by ObjectiveMetric::norm(), and ObjectiveMetric::setNorm().