73 if (&source ==
this)
return *
this;
85 const CoordinateType offset_min = model->getInterpolation().supportMin() - stdev1;
86 const CoordinateType offset_max = model->getInterpolation().supportMin() + stdev2;
92 std::vector<float> real_data;
93 real_data.reserve(set.size());
94 std::vector<float> model_data;
95 model_data.reserve(set.size());
97 for (
Size i = 0; i < set.size(); ++i)
99 real_data.push_back(set[i].getIntensity());
100 model_data.push_back(model->getIntensity(
DPosition<1>(set[i].getPosition())));
103 CoordinateType max_offset = model->getInterpolation().getOffset();
107 for (offset = offset_min; offset <= offset_max; offset += offset_step)
110 model->setOffset(offset);
114 for (
Size i = 0; i < set.size(); ++i)
116 model_data.push_back(model->getIntensity(
DPosition<1>(set[i].getPosition())));
121 if (correlation > max_correlation)
123 max_correlation = correlation;
128 model->setOffset(max_offset);
130 return max_correlation;
Abstract base class for all 1D-dimensional model fitter.
Definition: Fitter1D.h:62
std::vector< PeakType > RawDataArrayType
Peak type data container type using for the temporary storage of the input data.
Definition: Fitter1D.h:76
Feature::QualityType QualityType
Quality of a feature.
Definition: Fitter1D.h:72
Feature::CoordinateType CoordinateType
Single coordinate.
Definition: Fitter1D.h:70
virtual Fitter1D & operator=(const Fitter1D &source)
assignment operator
void updateMembers_() override
This method is used to update extra member variables at the end of the setParameters() method.
Abstract base class for all 1D-model fitters using maximum likelihood optimization.
Definition: MaxLikeliFitter1D.h:49
MaxLikeliFitter1D(const MaxLikeliFitter1D &source)
copy constructor
Definition: MaxLikeliFitter1D.h:60
MaxLikeliFitter1D()
default constructor
Definition: MaxLikeliFitter1D.h:54
void updateMembers_() override
This method is used to update extra member variables at the end of the setParameters() method.
Definition: MaxLikeliFitter1D.h:133
virtual MaxLikeliFitter1D & operator=(const MaxLikeliFitter1D &source)
assignment operator
Definition: MaxLikeliFitter1D.h:71
QualityType fitOffset_(std::unique_ptr< InterpolationModel > &model, const RawDataArrayType &set, const CoordinateType stdev1, const CoordinateType stdev2, const CoordinateType offset_step) const
fit an offset on the basis of the Pearson correlation coefficient
Definition: MaxLikeliFitter1D.h:83
~MaxLikeliFitter1D() override
destructor
Definition: MaxLikeliFitter1D.h:66
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:127
static double pearsonCorrelationCoefficient(IteratorType1 begin_a, IteratorType1 end_a, IteratorType2 begin_b, IteratorType2 end_b)
Calculates the Pearson correlation coefficient for the values in [begin_a, end_a) and [begin_b,...
Definition: StatisticFunctions.h:534
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47