* Mothur
*
* Created by Thomas Ryabin on 2/23/09.
- * Copyright 2009 __MyCompanyName__. All rights reserved.
+ * Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
*
*/
#include "logsd.h"
-#include "calculator.h"
/***********************************************************************/
SAbundVector rankw = SAbundVector(dvec, mr,nb,ns);
SAbundVector *rank = &rankw;*/
- data.resize(2,0);
+ data.resize(3,0);
int numInd = rank->getNumSeqs();
int numSpec = rank->getNumBins();
double snRatio = (double)numSpec/numInd;
if(diff > maxDiff)
maxDiff = diff;
}
-
- double DStatistic = (maxDiff + .5)/numSpec;
+
+
/*cout << "LogSD:\n";
cout << "D Test Statistic = " << DStatistic << "\n";
cout << ".05 confidence value = " << .89196/sqrt(numSpec) << "\n";
cout << "If D Test Statistic is greater than the critical value then the data fits the Log Series Distribution model w/ 95% confidence.\n\n";*/
- data[0] = DStatistic;
- data[1] = .89196/sqrt(numSpec);
+ data[0] = (maxDiff + .5)/numSpec;
+ data[1] = 0.886/sqrt(numSpec);
+ data[2] = 1.031/sqrt(numSpec);
+
if (isnan(data[0]) || isinf(data[0])) { data[0] = 0; }
if (isnan(data[1]) || isinf(data[1])) { data[1] = 0; }
+ if (isnan(data[2]) || isinf(data[2])) { data[2] = 0; }
+
return data;
}
catch(exception& e) {