Examples of qks()


Examples of com.nr.sf.KSdist.qks()

      dt=max(abs(fo-ff),abs(fn-ff));
      if (dt > d.val) d.val=dt;
      fo=fn;
    }
    en=sqrt(en);
    prob.val=ks.qks((en+0.12+0.11/en)*d.val);
  }
 
  /**
   Given an array data1[0..n1-1], and an array data2[0..n2-1], this routine returns the K-S
   statistic d and the p-value prob for the null hypothesis that the data sets are drawn from the same
View Full Code Here

Examples of com.nr.sf.KSdist.qks()

          fn2=++j2/en2;
        while (j2 < n2 && d2 == data2[j2]);
      if ((dt=abs(fn2-fn1)) > d.val) d.val=dt;
    }
    en=sqrt(en1*en2/(en1+en2));
    prob.val=ks.qks((en+0.12+0.11/en)*d.val);
  }
 
  /*
   Given an origin (x, y), and an array of nn points with coordinatesssss xx[0..nn-1] and yy[0..nn-1],
   count how many of them are in each quadrant around the origin, ad return the normalized fractions.
View Full Code Here

Examples of com.nr.sf.KSdist.qks()

      d1.val=max(d1.val,abs(fd.val-gd.val));
    }
    pearsn(x1,y1,r1,dum,dumm);
    sqen=sqrt(n1);
    rr=sqrt(1.0-r1.val*r1.val);
    prob.val=ks.qks(d1.val*sqen/(1.0+rr*(0.25-0.75/sqen)));
  }
 
 
  /*
  Two-dimensional  Kolmogorov-Smirnov test on two samples. Given the x and y coordinates of the first
View Full Code Here

Examples of com.nr.sf.KSdist.qks()

    d.val=0.5*(d1+d2);
    sqen=sqrt(n1*n2/(n1+n2));
    pearsn(x1,y1,r1,dum,dumm);
    pearsn(x2,y2,r2,dum,dumm);
    rr=sqrt(1.0-0.5*(r1.val*r1.val+r2.val*r2.val));
    prob.val=ks.qks(d.val*sqen/(1.0+rr*(0.25-0.75/sqen)));
  }
}
View Full Code Here

Examples of com.nr.sf.KSdist.qks()

    if (localflag) {
      fail("*** KSdist: Special case #1 failed for Pks");
     
    }

    localflag = abs(norm.qks(z)-1.0) > sbeps;
    globalflag = globalflag || localflag;
    if (localflag) {
      fail("*** KSdist: Special case #1 failed for Qks");
     
    }
View Full Code Here

Examples of com.nr.sf.KSdist.qks()

    if (localflag) {
      fail("*** KSdist: Special case #2 failed for Pks");
     
    }

    localflag = abs(norm.qks(z)-2.0*exp(-2.0)+2.0*exp(-8.0)-2.0*exp(-18.0)) > sbeps;
    globalflag = globalflag || localflag;
    if (localflag) {
      fail("*** KSdist: Special case #2 failed for Qks");
     
    }
View Full Code Here

Examples of com.nr.sf.KSdist.qks()

    if (localflag) {
      fail("*** KSdist: Special case #3 failed for Pks");
     
    }

    localflag = abs(norm.qks(z)-0.0) > sbeps;
    globalflag = globalflag || localflag;
    if (localflag) {
      fail("*** KSdist: Special case #3 failed for Qks");
     
    }
View Full Code Here

Examples of com.nr.sf.KSdist.qks()

    }

    // Pks correctly related to Qks
    localflag=false;
    for (i=0;i<N;i++)
      localflag = localflag || 1.0-norm.pks(x[i])-norm.qks(x[i]) > sbeps;
    globalflag = globalflag || localflag;
    if (localflag) {
      fail("*** KSdist: Pks and Qks do not add to 1.0 in all cases");
     
    }
View Full Code Here

Examples of com.nr.sf.KSdist.qks()

    // inverse of Qks agrees with Qks
    localflag=false;
    sbeps=5.e-10;
    for (i=0;i<1000;i++) {
      z=0.3+3.0*myran.doub();
      a=norm.qks(z);
      b=norm.invqks(a);
//      if (abs(z-b) > sbeps) {
//        System.out.printf(setprecision(15) << z << " %f\n", b << " %f\n", abs(z-b));
//      }
      localflag = localflag || abs(z-b) > sbeps;
View Full Code Here

Examples of com.nr.sf.KSdist.qks()

    }

    // Fingerprint test for Qks
    sbeps=1.e-15;
    for (i=0;i<N;i++) {
      qks[i]=norm.qks(x[i]);
//      System.out.printf(setprecision(17) << qks[i]);
    }
//    System.out.println("KSdist: Maximum discrepancy = %f\n", maxel(vecsub(qks,qksexp)));
    localflag = maxel(vecsub(qks,qksexp)) > sbeps;
    globalflag = globalflag || localflag;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.