|
BornAgain
1.18.0
Simulate and fit neutron and x-ray scattering at grazing incidence
|
Implementation of relative difference metric. More...
Inheritance diagram for RelativeDifferenceMetric:Public Member Functions | |
| RelativeDifferenceMetric * | clone () const override |
| 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. More... | |
| double | computeFromArrays (std::vector< double > sim_data, std::vector< double > exp_data, std::vector< double > uncertainties, std::vector< double > weight_factors) const override |
| Computes metric value from data arrays. 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. More... | |
Public Member Functions inherited from Chi2Metric | |
| double | computeFromArrays (std::vector< double > sim_data, std::vector< double > exp_data, std::vector< double > uncertainties, std::vector< double > weight_factors) const override |
| Computes metric value from data arrays. More... | |
Public Member Functions inherited from ObjectiveMetric | |
| ObjectiveMetric (std::function< double(double)> norm) | |
| virtual double | compute (const SimDataPair &data_pair, bool use_weights) const |
| Computes metric value from SimDataPair object. More... | |
| void | setNorm (std::function< double(double)> norm) |
| auto | norm () const |
| Returns a copy of the normalization function used. | |
Public Member Functions inherited from ICloneable | |
| ICloneable (const ICloneable &)=delete | |
| ICloneable (ICloneable &&)=default | |
| virtual void | transferToCPP () |
| Used for Python overriding of clone (see swig/tweaks.py) | |
Implementation of relative difference metric.
With default L2 norm and weighting off corresponds to the formula
where
is the simulated intensity,
- experimental data. If weighting is on, falls back to the standard
metric.
Definition at line 167 of file ObjectiveMetric.h.
|
overridevirtual |
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. |
Reimplemented from Chi2Metric.
Definition at line 203 of file ObjectiveMetric.cpp.
|
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.
| sim_data | array with simulated intensities. |
| exp_data | array with intensity values obtained from an experiment. |
| uncertainties | array with experimental data uncertainties. |
| weight_factors | user-defined weighting factors. Used linearly, no matter which norm is chosen. |
Definition at line 87 of file ObjectiveMetric.cpp.
|
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.
| 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. |
Definition at line 98 of file ObjectiveMetric.cpp.