Opened 16 years ago

Last modified 16 years ago

#258 new enhancement

Permutation test

Reported by: Peter Owned by: Peter
Priority: major Milestone: yat 0.x+
Component: statistics Version: trunk
Keywords: Cc:

Description (last modified by Peter)

I tend to write the same code over and over again

double threshold = score(target);
Averager p = 0;
for (size_t i=0; i<N; ++i){ 
  if (score(target)>=threshold)
    p.add(1);
  else
    p.add(0);
  target.shuffle()
}
cout << p.mean() << endl;

Perhaps we should have a function or class for doing it. The main component is calling score here which should be a functor class. Sometimes these kind of calculations can be quite computational so perhaps one should have the ability to write some intermediate result to an ostream* (if NULL no reporting???).

Change History (2)

comment:1 Changed 16 years ago by Peter

Description: modified (diff)

comment:2 Changed 16 years ago by Jari Häkkinen

Milestone: 0.4later
Note: See TracTickets for help on using tickets.