Skip to content

Commit

Permalink
Remove ttest from pySpikeDB. Better to just use python libraries.
Browse files Browse the repository at this point in the history
  • Loading branch information
baubie committed Apr 1, 2012
1 parent a2a7796 commit b92d07e
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 36 deletions.
34 changes: 0 additions & 34 deletions src/pySpikeDB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -724,40 +724,6 @@ double pySpikeDB::stddev(boost::python::list &v)
return sqrt(r/(rN-1));
}

bp::object pySpikeDB::ttest(bp::list &a, bp::list &b, bool eqvar)
{
bp::dict r;
double t = 0;
double p = 0;
double df = 0;
double ma = mean(a);
double mb = mean(b);
double sa = stddev(a);
double sb = stddev(b);
double na = bp::len(a);
double nb = bp::len(b);
df = na + nb - 2;

if (eqvar)
{
if (bp::len(a) == bp::len(b))
{
double S = sqrt(0.5*(sa*sa+sb*sb));
t = (ma-mb)/(S*sqrt(2.0/na));
} else {
double S = sqrt(((na-1)*sa*sa+(nb-1)*sb*sb)/(na+nb-2));
t = (ma-mb)/(S*sqrt(1.0/na + 1.0/nb));
}
} else {
// Unequal variance not yet implemented
}
r["t"] = t>0?t:-t; // Absolute value
r["p1"] = p;
r["p2"] = p;
r["df"] = df;
return r;
}

pySpikeDB::Option* pySpikeDB::findOptionByName(const Glib::ustring &name) {

std::vector<boost::shared_ptr<Option> >::iterator it;
Expand Down
1 change: 0 additions & 1 deletion src/pySpikeDB.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ class pySpikeDB {

double stddev(boost::python::list &v);
double mean(boost::python::list &v);
boost::python::object ttest(boost::python::list &a, boost::python::list &b, bool eqvar);

void print(const std::string &s);

Expand Down
1 change: 0 additions & 1 deletion src/uiAnalysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,6 @@ if (!uiAnalysis::setupPython)
.def("getFilesSingleCell", &pySpikeDB::getFilesSingleCell)
.def("mean", &pySpikeDB::mean)
.def("stddev", &pySpikeDB::stddev)
.def("ttest", &pySpikeDB::ttest)
.def("filterSpikesAbs", &pySpikeDB::filterSpikesAbs)
.def("filterSpikesRel", &pySpikeDB::filterSpikesRel)
.def("plotXLabel", &pySpikeDB::plotXLabel)
Expand Down

0 comments on commit b92d07e

Please sign in to comment.