libpappsomspp
Library for mass spectrometry
linearregression.h
Go to the documentation of this file.
1/**
2 * \file utils/linearregression.h
3 * \date 17/9/2016
4 * \author Olivier Langella
5 * \brief compute linear regression
6 */
7
8/*******************************************************************************
9 * Copyright (c) 2016 Olivier Langella <Olivier.Langella@u-psud.fr>.
10 *
11 * This file is part of peptider.
12 *
13 * peptider is free software: you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation, either version 3 of the License, or
16 * (at your option) any later version.
17 *
18 * peptider is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
22 *
23 * You should have received a copy of the GNU General Public License
24 * along with peptider. If not, see <http://www.gnu.org/licenses/>.
25 *
26 ******************************************************************************/
27#pragma once
28#include "trace.h"
29
30namespace pappso
31{
33{
34 public:
35 LinearRegression(const Trace &data);
36 double getYfromX(double score) const;
37 double getIntercept() const;
38 double getSlope() const;
39
40 /** @brief get Root-Mean-Square Deviation
41 */
42 double getRmsd(const Trace &data) const;
43 /** @brief get Normalized Root-Mean-Square Deviation
44 */
45 double getNrmsd(const Trace &data) const;
46 /** @brief get Coefficient of determination (R2)
47 */
48 double getCoefficientOfDetermination(const Trace &data) const;
49
50 private:
51 double _slope = 0;
52 double _intercept = 0;
53};
54} // namespace pappso
double getNrmsd(const Trace &data) const
get Normalized Root-Mean-Square Deviation
double getYfromX(double score) const
double getCoefficientOfDetermination(const Trace &data) const
get Coefficient of determination (R2)
double getRmsd(const Trace &data) const
get Root-Mean-Square Deviation
LinearRegression(const Trace &data)
A simple container of DataPoint instances.
Definition: trace.h:38
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition: aa.cpp:39