source: trunk/test/loglikelihood_ratio_test_binomial.cc @ 3134

Last change on this file since 3134 was 3134, checked in by Peter, 8 years ago

refs #769 skeleton for new class LoglikelihoodRatioTestBinomial? (not yet functional).

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 1.4 KB
Line 
1// $Id: loglikelihood_ratio_test_binomial.cc 3134 2013-11-27 06:12:16Z peter $
2
3/*
4  Copyright (C) 2013 Peter Johansson
5
6  This file is part of the yat library, http://dev.thep.lu.se/yat
7
8  The yat library is free software; you can redistribute it and/or
9  modify it under the terms of the GNU General Public License as
10  published by the Free Software Foundation; either version 3 of the
11  License, or (at your option) any later version.
12
13  The yat library is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  General Public License for more details.
17
18  You should have received a copy of the GNU General Public License
19  along with yat. If not, see <http://www.gnu.org/licenses/>.
20*/
21
22#include <config.h>
23
24#include "Suite.h"
25
26#include "yat/statistics/LoglikelihoodRatioTestBinomial.h"
27
28using namespace theplu::yat;
29
30int main(int argc, char* argv[])
31{
32  test::Suite suite(argc, argv);
33
34  statistics::LoglikelihoodRatioTestBinomial lrt;
35
36  suite.add(lrt.size() == 2);
37
38  lrt.add(0, true, 2);
39  lrt.add(0, false, 200);
40  lrt.add(1, false, 5000);
41
42  suite.add(lrt.n() == 5202);
43  suite.add(lrt.n(0) == 202);
44  suite.add(lrt.n(1) == 5000);
45
46  suite.add(lrt.positive(0) == 2);
47  suite.add(lrt.negative(0) == 200);
48  suite.add(lrt.positive(1) == 0);
49  suite.add(lrt.negative(1) == 5000);
50
51  double log_lambda = lrt();
52  suite.out() << log_lambda << "\n";
53  suite.add(log_lambda > 0);
54
55  return suite.return_value();
56}
Note: See TracBrowser for help on using the repository browser.