41 modelmanager.
Copy(*
this);
48 if (
this != &modelmanager)
49 modelmanager.
Copy(*
this);
62 for (
unsigned int i = 0; i <
GetNModels(); i++)
107 for (
unsigned int i = 0; i <
GetNModels(); i++)
114 for (
unsigned int i = 0; i <
GetNModels(); i++)
121 for (
unsigned int i = 0; i <
GetNModels(); i++)
128 for (
unsigned int i = 0; i <
GetNModels(); i++)
138 for (
unsigned int i = 0; i <
GetNModels(); i++)
147 for (
unsigned int i = 0; i <
GetNModels(); i++)
156 for (
unsigned int i = 0; i <
GetNModels(); i++)
165 for (
unsigned int i = 0; i <
GetNModels(); i++)
174 for (
unsigned int i = 0; i <
GetNModels(); i++)
183 for (
unsigned int i = 0; i <
GetNModels(); i++)
192 for (
unsigned int i = 0; i <
GetNModels(); i++)
201 for (
unsigned int i = 0; i <
GetNModels(); i++)
210 for (
unsigned int i = 0; i <
GetNModels(); i++)
219 for (
unsigned int i = 0; i <
GetNModels(); i++)
228 for (
unsigned int i = 0; i <
GetNModels(); i++)
236 for (
unsigned int i = 0; i <
GetNModels(); i++)
245 BCLog::OutError(
"BCModelManager::ReadDataFromFileTree : No model defined.");
261 for (
unsigned int i = 0; i <
GetNModels(); i++)
264 else if (read_file == -1) {
277 BCLog::OutError(
"BCModelManager::ReadDataFromFileTree. No model defined.");
293 for (
unsigned int i = 0; i <
GetNModels(); i++)
309 double normalization = 0.0;
313 for (
unsigned int i = 0; i <
GetNModels(); i++) {
321 for (
unsigned int i = 0; i <
GetNModels(); i++)
342 Form(
"BCModelManager::BayesFactor : Model %s (index %d) not normalized. Cannot calculate Bayes factor.",
350 Form(
"BCModelManager::BayesFactor : Model %s (index %d) not normalized. Cannot calculate Bayes factor.",
356 if(norm2==0. && norm1!=0.) {
358 Form(
"BCModelManager::BayesFactor : Model %s (index %d) has ZERO probability. Bayes factor is infinite.",
364 if(norm2==0. && norm1==0.) {
366 Form(
"BCModelManager::BayesFactor : Models %s and %s have ZERO probability. Bayes factor is unknown. Returning 1.",
380 for (
unsigned int i = 0; i <
GetNModels(); i++)
389 for (
unsigned int i = 0; i <
GetNModels(); i++)
398 for (
unsigned int i = 0; i <
GetNModels(); i++)
407 for (
unsigned int i = 0; i <
GetNModels(); i++)
416 std::streambuf * old_buffer = 0;
420 if (!out.is_open()) {
421 std::cerr<<
"Couldn't open file "<<file<<std::endl;
424 old_buffer = std::cout.rdbuf(out.rdbuf());
430 <<
"======================================"<<std::endl
431 <<
" Summary"<<std::endl
432 <<
"======================================"<<std::endl
434 <<
" Number of models : "<<nmodels<<std::endl
436 <<
" - Models:"<<std::endl;
438 for (
int i = 0; i < nmodels; i++)
442 std::cout<<
" - Data:"<<std::endl
447 std::cout<<
"======================================"<<std::endl
448 <<
" Model comparison"<<std::endl
452 std::cout<<
" - A priori probabilities:"<<std::endl<<std::endl;
454 for (
int i=0; i<nmodels; i++)
458 std::cout<<std::endl;
460 std::cout<<
" - A posteriori probabilities:"<<std::endl<<std::endl;
462 for (
int i = 0; i < nmodels; i++)
464 <<
" | data) = "<<
fModelContainer->at(i)->GetModelAPosterioriProbability()
466 std::cout<<std::endl;
468 std::cout<<
"======================================"<<std::endl<<std::endl;
471 std::cout.rdbuf(old_buffer);
480 std::streambuf * old_buffer = 0;
484 if (!out.is_open()) {
485 std::cerr<<
"Couldn't open file "<<file<<std::endl;
488 old_buffer = std::cout.rdbuf(out.rdbuf());
494 <<
"==========================================="<<std::endl
495 <<
" Model Comparison Summary"<<std::endl
496 <<
"==========================================="<<std::endl
498 <<
" Number of models : "<<nmodels<<std::endl
502 std::cout<<
" - A priori probabilities:"<<std::endl<<std::endl;
504 for (
int i=0; i<nmodels; i++)
508 std::cout<<std::endl;
510 std::cout<<
" - A posteriori probabilities:"<<std::endl<<std::endl;
512 for (
int i = 0; i < nmodels; i++)
514 <<
" | data) = "<<
fModelContainer->at(i)->GetModelAPosterioriProbability()
516 std::cout<<std::endl;
519 std::cout<<
" - Bayes factors:"<<std::endl<<std::endl;
520 for (
int i = 0; i < nmodels-1; i++)
521 for (
int j = i+1; j < nmodels; j++)
525 std::cout<<std::endl;
529 <<
" - p-values:"<<std::endl
532 for (
int i = 0; i < nmodels; i++)
537 std::cout<<
": p-value = "<< p;
539 std::cout<<
": p-value not calculated";
540 std::cout<<std::endl;
542 std::cout<<std::endl;
544 std::cout<<
"==========================================="<<std::endl<<std::endl;
547 std::cout.rdbuf(old_buffer);
556 for (
unsigned int i = 0; i <
GetNModels(); i++)