OpenMS
Loading...
Searching...
No Matches
GumbelMaxLikelihoodFitter.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: Julianus Pfeuffer $
6// $Authors: Julianus Pfeuffer $
7// --------------------------------------------------------------------------
8//
9#pragma once
10
12#include <vector>
13
14
15namespace OpenMS
16{
17 namespace Math
18 {
31 class OPENMS_DLLAPI GumbelMaxLikelihoodFitter
32 {
33
34public:
35
37 struct OPENMS_DLLAPI GumbelDistributionFitResult
38 {
39 GumbelDistributionFitResult(double local_a, double local_b) :
40 a(local_a),
41 b(local_b)
42 {
43 }
44
46 double a;
48 double b;
49
51 double log_eval_no_normalize(double x) const;
52
54 double eval(double x) const;
55
57 double mode() const;
58 };
59
66
69
86 GumbelDistributionFitResult fitWeighted(const std::vector<double> & x, const std::vector<double> & w);
87
88protected:
89
91
92private:
97 };
98 }
99}
Implements a fitter for the Gumbel distribution.
Definition GumbelMaxLikelihoodFitter.h:32
virtual ~GumbelMaxLikelihoodFitter()
Destructor.
GumbelMaxLikelihoodFitter(const GumbelMaxLikelihoodFitter &rhs)
Copy constructor (not implemented)
GumbelDistributionFitResult fitWeighted(const std::vector< double > &x, const std::vector< double > &w)
Fits a Gumbel (maximum) distribution to the data points x with weights w by weighted maximum likeliho...
GumbelDistributionFitResult init_param_
Definition GumbelMaxLikelihoodFitter.h:90
GumbelMaxLikelihoodFitter & operator=(const GumbelMaxLikelihoodFitter &rhs)
assignment operator (not implemented)
GumbelMaxLikelihoodFitter(GumbelDistributionFitResult init)
Default constructor.
GumbelMaxLikelihoodFitter()
Default constructor.
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 GumbelMaxLikelihoodFitter.h:38
double a
location parameter a
Definition GumbelMaxLikelihoodFitter.h:46
double b
scale parameter b
Definition GumbelMaxLikelihoodFitter.h:48
double log_eval_no_normalize(double x) const
log density at x. Note: despite its name, the density is fully normalized.
double eval(double x) const
(normalized) density at x
GumbelDistributionFitResult(double local_a, double local_b)
Definition GumbelMaxLikelihoodFitter.h:39
double mode() const
mode of the distribution (equals the location parameter a)