BayesianAnalysisToolkit
0.9.3
Main Page
Namespaces
Classes
Files
File List
File Members
BAT
BCModelManager.h
Go to the documentation of this file.
1
#ifndef __BCMODELMANAGER__H
2
#define __BCMODELMANAGER__H
3
17
/*
18
* Copyright (C) 2007-2013, the BAT core developer team
19
* All rights reserved.
20
*
21
* For the licensing terms see doc/COPYING.
22
* For documentation see http://mpp.mpg.de/bat
23
*/
24
25
// ---------------------------------------------------------
26
27
#include "
BCModel.h
"
28
#include "
BCDataSet.h
"
29
30
// ---------------------------------------------------------
31
32
class
BCModelManager
33
{
34
public
:
35
41
BCModelManager
();
42
45
BCModelManager
(
const
BCModelManager
& modelmanager);
46
49
virtual
~BCModelManager
();
50
58
BCModelManager
&
operator =
(
const
BCModelManager
& modelmanager);
59
67
unsigned
int
GetNModels
()
68
{
return
fModelContainer
-> size(); };
69
74
BCModel
*
GetModel
(
int
index)
75
{
return
fModelContainer
-> at(index); };
76
80
int
GetNDataPoints
()
81
{
return
(
fDataSet
) ?
fDataSet
->
GetNDataPoints
() : 0; };
82
87
BCDataPoint
*
GetDataPoint
(
int
index)
88
{
return
fDataSet
->
GetDataPoint
(index); };
89
93
BCDataSet
*
GetDataSet
()
94
{
return
fDataSet
; };
95
105
void
SetDataSet
(
BCDataSet
* dataset);
106
112
void
SetSingleDataPoint
(
BCDataPoint
* datapoint);
113
120
void
SetSingleDataPoint
(
BCDataSet
* dataset,
unsigned
int
index);
121
122
void
SetNIterationsMax
(
int
niterations);
123
128
void
SetNIterationsMin
(
int
niterations);
129
132
void
SetNIterationsPrecisionCheck
(
int
niterations);
133
136
void
SetNIterationsOutput
(
int
niterations);
139
void
SetMarginalizationMethod
(
BCIntegrate::BCMarginalizationMethod
method);
140
143
void
SetIntegrationMethod
(
BCIntegrate::BCIntegrationMethod
method);
144
147
void
SetOptimizationMethod
(
BCIntegrate::BCOptimizationMethod
method);
148
152
void
SetRelativePrecision
(
double
relprecision);
153
156
void
SetAbsolutePrecision
(
double
absprecision);
157
161
void
SetNbins
(
unsigned
int
n);
162
166
void
SetDataPointLowerBoundaries
(
BCDataPoint
* datasetlowerboundaries);
167
171
void
SetDataPointUpperBoundaries
(
BCDataPoint
* datasetupperboundaries);
172
176
void
SetDataPointLowerBoundary
(
int
index,
double
lowerboundary);
177
181
void
SetDataPointUpperBoundary
(
int
index,
double
upperboundary);
182
186
void
SetDataBoundaries
(
int
index,
double
lowerboundary,
double
upperboundary);
187
190
void
SetNChains
(
unsigned
int
n);
191
203
void
AddModel
(
BCModel
* model,
double
probability=0.);
204
208
void
AddDataPoint
(
BCDataPoint
* datapoint)
209
{
fDataSet
->
AddDataPoint
(datapoint); };
210
214
int
ReadDataFromFile
(
const
char
* filename,
const
char
* treename,
const
char
* branchnames)
215
{
return
this
->
ReadDataFromFileTree
(filename, treename, branchnames); };
216
217
int
ReadDataFromFile
(
const
char
* filename,
int
nvariables)
218
{
return
this
->
ReadDataFromFileTxt
(filename, nvariables); };
219
229
int
ReadDataFromFileTree
(
const
char
* filename,
const
char
* treename,
const
char
* branchnames);
230
239
int
ReadDataFromFileTxt
(
const
char
* filename,
int
nbranches);
240
244
void
Integrate
();
245
251
double
BayesFactor
(
const
unsigned
int
imodel1,
const
unsigned
int
imodel2);
252
255
void
FindMode
();
256
260
void
MarginalizeAll
();
261
264
void
WriteMarkovChain
(
bool
flag);
265
268
void
ResetDataSet
()
269
{
fDataSet
-> Reset(); };
270
275
void
PrintModelComparisonSummary
(
const
char
* filename=0);
276
282
void
PrintSummary
(
const
char
* filename=0);
283
286
void
PrintResults
();
287
290
void
CalculatePValue
(
bool
flag_histogram=
false
);
291
294
private
:
295
298
void
Copy
(
BCModelManager
& modelmanager)
const
;
299
302
BCModelContainer
*
fModelContainer
;
303
306
BCDataSet
*
fDataSet
;
307
308
};
309
310
// ---------------------------------------------------------
311
312
#endif
Generated by
1.8.4