package uk.ac.leeds.ccg.cluster; // Poisson tests class for cluster methods // A modification of GamPoissonTest written by J R Davy Jan 1998 //import com.sun.java.util.collections.*; import java.util.*; public class PoissonTest extends SignificanceTest implements Constants { double stat = (double) 0.0; public PoissonTest() { cons = new double[MAXCAN]; canMax = MAXCAN; System.out.println(" *Poisson Test used with MAXIMUM case count of " + MAXCAN); for (int i=1; i< MAXCAN; i++) { cons[i] = ((double) 1.0)/i; } } // public final boolean isSignificant(double sumP, double sumC, MyDouble statis) public final boolean isSignificant(Vector points) throws PoissonException { double totpop = (double) 0.0; double totcases = (double) 0.0; MyPoint p2; double cumPrb[]; cumPrb = new double[MAXCAN]; // int jA = (int) sumC; // double aMean = (double) sumP; double prob; for(int j=0;j canMax) throw new PoissonException("Too many cases for a Poisson Test"); } catch(PoissonException e){ System.err.println(e.toString() ); System.exit(1); } if (jA > 1) { cumPrb[0] = Math.exp(-aMean); prob = cumPrb[0]; for(int j=1; j