Egglib 2.1.11
C++ library reference manual
ABC.hpp
1 /*
2  Copyright 2011 Stéphane De Mita
3 
4  This file is part of the EggLib library.
5 
6  EggLib is free software: you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  EggLib is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with EggLib. If not, see <http://www.gnu.org/licenses/>.
18 */
19 
20 
21 #ifndef EGGLIB_ABC_HPP
22 #define EGGLIB_ABC_HPP
23 
24 #include <vector>
25 #include <string>
26 
27 
28 namespace egglib {
29 
49  class ABC {
50 
51  public:
52 
53 
55  enum TransformMode { NONE, LOG, TAN };
56 
57 
59  ABC();
60 
61 
63  ~ABC();
64 
65 
72  void number_of_statistics(unsigned int ns);
73 
74 
76  void add_fname(const char* fname, unsigned int number_of_params);
77 
78 
80  unsigned int number_of_samples() const;
81 
82 
94  void get_threshold(double tolerance);
95 
96 
103  double sd(unsigned int index) const;
104 
105 
112  void obs(unsigned int index, double value);
113 
114 
128  unsigned int rejection(const char* outfname, bool exportlabels=false);
129 
140  unsigned int regression(const char* infname,
141  const char* outfname,
142  TransformMode mode,
143  const char* header = "");
144 
145 
147  double threshold() const;
148 
149  private:
150 
151  ABC(const ABC& src) {}
152  ABC& operator=(const ABC& src) {return *this;}
153 
154  void init();
155  void clear();
156 
157  double *_sd;
158  double *_obs;
159  unsigned int _nstats;
160  unsigned int _nsam;
161  double _threshold;
162  std::vector<std::string> _fnames;
163  std::vector<unsigned int> _nparams;
164 
165  };
166 
167 }
168 
169 #endif
ABC()
Constructor.
Definition: ABC.cpp:45
Model estimation by Approximate Bayesian Computation.
Definition: ABC.hpp:49
void obs(unsigned int index, double value)
Sets a summary statistics.
Definition: ABC.cpp:110
double sd(unsigned int index) const
Gets a standard deviation.
Definition: ABC.cpp:102
void get_threshold(double tolerance)
Gets regression threshold.
Definition: ABC.cpp:119
unsigned int regression(const char *infname, const char *outfname, TransformMode mode, const char *header="")
Performs regression step.
Definition: ABC.cpp:393
unsigned int number_of_samples() const
Gets number of imported data samples.
Definition: ABC.cpp:627
Definition: ABC.cpp:37
~ABC()
Destructor.
Definition: ABC.cpp:50
double threshold() const
Gets Euclidean threshold.
Definition: ABC.cpp:631
unsigned int rejection(const char *outfname, bool exportlabels=false)
Performs rejection step.
Definition: ABC.cpp:309
void number_of_statistics(unsigned int ns)
Sets number of statistics.
Definition: ABC.cpp:72
void add_fname(const char *fname, unsigned int number_of_params)
Adds a file name.
Definition: ABC.cpp:93
TransformMode
Modes for parameter transformation.
Definition: ABC.hpp:55

Hosted by 
Get EggLib at SourceForge.net. Fast, secure and Free Open Source software downloads