OpenMS
GumbelDistributionFitter.h
Go to the documentation of this file.
1 // Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin
2 // SPDX-License-Identifier: BSD-3-Clause
3 //
4 // --------------------------------------------------------------------------
5 // $Maintainer: Timo Sachsenberg $
6 // $Authors: $
7 // --------------------------------------------------------------------------
8 //
9 #pragma once
10 
13 
14 #include <vector>
15 
16 
17 namespace OpenMS
18 {
19  namespace Math
20  {
33  class OPENMS_DLLAPI GumbelDistributionFitter
34  {
35 public:
36 
39  {
40  GumbelDistributionFitResult(double local_a = 1.0, double local_b = 2.0) :
41  a(local_a),
42  b(local_b)
43  {
44  }
45 
47  double a;
49  double b;
50 
51  double eval(double x) const;
52  double log_eval_no_normalize(double x) const ;
53  };
54 
59 
62 
70  GumbelDistributionFitResult fit(std::vector<DPosition<2> > & points) const;
71 
81  GumbelDistributionFitResult fitWeighted(const std::vector<double> & x, const std::vector<double> & w);
82 
83 protected:
84 
86 
87 private:
92  };
93  }
94 }
95 
Implements a fitter for the Gumbel distribution.
Definition: GumbelDistributionFitter.h:34
virtual ~GumbelDistributionFitter()
Destructor.
GumbelDistributionFitter & operator=(const GumbelDistributionFitter &rhs)
assignment operator (not implemented)
GumbelDistributionFitter()
Default constructor.
GumbelDistributionFitter(const GumbelDistributionFitter &rhs)
Copy constructor (not implemented)
GumbelDistributionFitResult fit(std::vector< DPosition< 2 > > &points) const
Fits a gumbel distribution to the given data points.
GumbelDistributionFitResult fitWeighted(const std::vector< double > &x, const std::vector< double > &w)
Fits a gumbel distribution to the given data x values. Fills a weighted histogram first and generates...
GumbelDistributionFitResult init_param_
Definition: GumbelDistributionFitter.h:85
void setInitialParameters(const GumbelDistributionFitResult &result)
sets the gumbel distribution start parameters a and b for the fitting
Main OpenMS namespace.
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19
struct to represent the parameters of a gumbel distribution
Definition: GumbelDistributionFitter.h:39
double a
location parameter a
Definition: GumbelDistributionFitter.h:47
double b
scale parameter b
Definition: GumbelDistributionFitter.h:49
GumbelDistributionFitResult(double local_a=1.0, double local_b=2.0)
Definition: GumbelDistributionFitter.h:40