yat  0.20.3pre
Anova.h
1 #ifndef _theplu_yat_statistics_anova_
2 #define _theplu_yat_statistics_anova_
3 
4 // $Id: Anova.h 4114 2021-10-13 04:36:16Z peter $
5 
6 /*
7  Copyright (C) 2021 Peter Johansson
8 
9  This file is part of the yat library, https://dev.thep.lu.se/yat
10 
11  The yat library is free software; you can redistribute it and/or
12  modify it under the terms of the GNU General Public License as
13  published by the Free Software Foundation; either version 3 of the
14  License, or (at your option) any later version.
15 
16  The yat library is distributed in the hope that it will be useful,
17  but WITHOUT ANY WARRANTY; without even the implied warranty of
18  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19  General Public License for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with yat. If not, see <https://www.gnu.org/licenses/>.
23 */
24 
25 #include <yat/statistics/Averager.h>
26 
27 #include <cstddef>
28 #include <vector>
29 
30 namespace theplu {
31 namespace yat {
32 namespace statistics {
33 
42  class Anova
43  {
44  public:
48  Anova(size_t n);
49 
57  void add(double x, size_t g, long int n=1);
58 
71  double F(void) const;
72 
76  size_t inter_df(void) const;
77 
81  size_t intra_df(void) const;
82 
89  double p_value(void) const;
90 
94  void reset(void);
95 
96  private:
97  std::vector<Averager> aver_;
98  Averager total_;
99  };
100 
101 }}}
102 
103 #endif
size_t inter_df(void) const
Class to calculate simple (first and second moments) averages.
Definition: Averager.h:46
The Department of Theoretical Physics namespace as we define it.
one-way ANOVA
Definition: Anova.h:42
size_t intra_df(void) const
double p_value(void) const
void add(double x, size_t g, long int n=1)
add a data point
void reset(void)
remove all data

Generated on Sat Feb 18 2023 03:31:44 for yat by  doxygen 1.8.14