isa = PBXGroup;
children = (
37D927BE0F21331F001D4494 /* calculator.h */,
- 373C69950FC1E63600137ACD /* boneh.h */,
- 373C69940FC1E63600137ACD /* boneh.cpp */,
- 3792948D0F2E271100B9034A /* treecalculator.h */,
37D927BD0F21331F001D4494 /* calculator.cpp */,
+ 3792948D0F2E271100B9034A /* treecalculator.h */,
37D927B90F21331F001D4494 /* ace.h */,
37D927B80F21331F001D4494 /* ace.cpp */,
EB1216860F619B83004A865F /* bergerparker.h */,
EB1216870F619B83004A865F /* bergerparker.cpp */,
+ 373C69950FC1E63600137ACD /* boneh.h */,
+ 373C69940FC1E63600137ACD /* boneh.cpp */,
37D927BC0F21331F001D4494 /* bootstrap.h */,
37D927BB0F21331F001D4494 /* bootstrap.cpp */,
EB1216E30F61ACFB004A865F /* bstick.h */,
sum = 0;
for(int j = 1; j < rank->size(); j++) {
- double Xi = 0; //I didn't know what this was, simply replace the 0
- //with the appropriate expression for the boneh calculator
- //to work.
- sum += pow(1 - Xi / n, n) * (1 - pow(1 - Xi / n, m)) + v * pow(1 - f1/(n*v), n) * (1 - pow(1 - f1/(n*v), m));
+ for (int i = 0; i < rank->get(j); i++) {
+ sum += pow(1 - j / n, n) * (1 - pow(1 - j / n, m)) + v * pow(1 - f1/(n*v), n) * (1 - pow(1 - f1/(n*v), m));
+ }
}
}
*/
#include "shen.h"
-#include <math.h>
+#include "ace.h"
/***********************************************************************/
EstOutput Shen::getValues(SAbundVector* rank){
try {
+ globaldata = GlobalData::getInstance();
+
data.resize(1,0);
double n = (double)rank->getNumSeqs();
double f1 = (double)rank->get(1);
- double D_rare = 0; //I didn't know what this was. Simply replace the '0' with the appropriate expression.
- double C_rare = 1; //I didn't know what this was. Simply replace the '1' with the appropriate expression.
- double Y_rare = 1; //I didn't know what this was. Simply replace the '1' with the appropriate expression.
+ int abund;
+ convert(globaldata->getAbund(), abund);
+
+ Ace* calc = new Ace(abund);
+ EstOutput ace = calc->getValues(rank);
- double f0 = D_rare/C_rare + f1/C_rare * Y_rare*Y_rare - D_rare;
+ double f0 = n - ace[0];
data[0] = f0 * (1 - pow(1 - f1/n/f0, m));
*/
#include "calculator.h"
+#include "globaldata.hpp"
/* This class implements the shen calculator on single group.
It is a child of the calculator class. */
EstOutput getValues(vector<SharedRAbundVector*>) {return data;};
private:
int m;
+ GlobalData* globaldata;
};