]> git.donarmstrong.com Git - mothur.git/blob - qFinderDMM.h
changes while testing
[mothur.git] / qFinderDMM.h
1 //
2 //  qFinderDMM.h
3 //  pds_dmm
4 //
5 //  Created by Patrick Schloss on 11/8/12.
6 //  Copyright (c) 2012 University of Michigan. All rights reserved.
7 //
8
9 #ifndef pds_dmm_qFinderDMM_h
10 #define pds_dmm_qFinderDMM_h
11
12 /**************************************************************************************************/
13
14 #include "mothurout.h"
15
16 /**************************************************************************************************/
17
18 class qFinderDMM {
19   
20 public:
21     qFinderDMM(vector<vector<int> >, int);
22     double getNLL()     {    return currNLL;        }  
23     double getAIC()     {    return aic;            }
24     double getBIC()     {    return bic;            }
25     double getLogDet()  {    return logDeterminant; }
26     double getLaplace() {    return laplace;        }
27     void printZMatrix(string, vector<string>);
28     void printRelAbund(string, vector<string>);
29
30 private:
31     MothurOut* m;
32     void kMeans();
33     void optimizeLambda();
34     void calculatePiK();
35
36     double negativeLogEvidenceLambdaPi(vector<double>&);
37     void negativeLogDerivEvidenceLambdaPi(vector<double>&, vector<double>&);
38     double getNegativeLogEvidence(vector<double>&, int);
39     double getNegativeLogLikelihood();
40     vector<vector<double> > getHessian();
41     
42     int lineMinimizeFletcher(vector<double>&, vector<double>&, double, double, double, double&, double&, vector<double>&, vector<double>&);
43     int bfgs2_Solver(vector<double>&);//, double, double);
44     double cheb_eval(const double[], int, double);
45     double psi(double);
46     double psi1(double);
47
48     vector<vector<int> > countMatrix;
49     vector<vector<double> > zMatrix;
50     vector<vector<double> > lambdaMatrix;
51     vector<double> weights;
52     vector<vector<double> > error;
53     
54     int numPartitions;
55     int numSamples;
56     int numOTUs;
57     int currentPartition;
58     
59     double currNLL;
60     double aic;
61     double bic;
62     double logDeterminant;
63     double laplace;
64     
65 };
66
67 /**************************************************************************************************/
68
69 #endif