Package org.netlib.util

Examples of org.netlib.util.doubleW


  }

  @Test
  public void test() {
    int i,NTRIES=100;
    doubleW faW=new doubleW(0),fbW = new doubleW(0);
    doubleW fcW = new doubleW(0),fdW = new doubleW(0);
    double x,y,fa,fb,fc,fd,sbeps;
    boolean localflag,globalflag=false;

   
View Full Code Here


  }

  @Test
  public void test() {
    int i,j,N=8192;
    doubleW fa=new doubleW(0),fb = new doubleW(0);
    doubleW fc = new doubleW(0),fd = new doubleW(0);
    double x=0.5,y=0.5;
    double ffa=0.25/4.0,ffb=0.25*3.0/4.0,ffc=0.25*9.0/4.0,ffd=0.25*3.0/4.0;
    double[] xx=new double[N],yy=new double[N];
    boolean localflag=false,globalflag=false;

View Full Code Here

  public void tearDown() throws Exception {
  }

  @Test
  public void test() {
    doubleW d1=new doubleW(0),zd1 = new doubleW(0),probd1 = new doubleW(0);
    doubleW rs1=new doubleW(0),probrs1 = new doubleW(0);
    doubleW d2=new doubleW(0),zd2 = new doubleW(0),probd2 = new doubleW(0);
    doubleW rs2=new doubleW(0),probrs2 = new doubleW(0);
   
    double sbeps=1.e-6;
    double adata[]={0.0,1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0};
    double bdata[]={9.0,8.0,7.0,6.0,5.0,4.0,3.0,2.0,1.0,0.0};
    double cdata[]={1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0,0.0}; // Note 0.0 at end
View Full Code Here

  public void tearDown() throws Exception {
  }

  @Test
  public void test() {
    doubleW tau1=new doubleW(0),z1 = new doubleW(0),prob1 = new doubleW(0);
    doubleW tau2=new doubleW(0),z2 = new doubleW(0),prob2 = new doubleW(0);
    double sbeps=1.e-6;
    double adata[]={0.0,1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0};
    double bdata[]={9.0,8.0,7.0,6.0,5.0,4.0,3.0,2.0,1.0,0.0};
    double cdata[]={1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0,0.0}; // Note 0.0 at end
    double edata[]={1.0,2.0,1.0,2.0,1.0,2.0,1.0,2.0,1.0,2.0};
View Full Code Here

  }

  @Test
  public void test() {
    int j,NPTS=10000;
    doubleW d1=new doubleW(0),prob1 = new doubleW(0);
    doubleW d2=new doubleW(0),prob2 = new doubleW(0);
    double[] data1=new double[NPTS],data2=new double[NPTS];
    boolean localflag=false,globalflag=false;

   
View Full Code Here

  }

  @Test
  public void test() {
    int i,j,NPTS=10000,NSHFT=10;
    doubleW ave1=new doubleW(0),ave2 = new doubleW(0);
    doubleW var1 = new doubleW(0), var2 = new doubleW(0);
    double EPS=0.01,sd,sbeps;
    double fingerprint[]={0.024980,0.072904,0.178591,0.369851,0.653879,
      1.0,0.653879,0.369851,0.178591,0.072904,0.024980};
    double[] data1=new double[NPTS],data2=new double[NPTS];
    double[] t=new double[NSHFT+1],prob=new double[NSHFT+1],tt= new double[NSHFT+1];
    boolean localflag=false,globalflag=false;

   

    // Test tutest
    System.out.println("Testing tutest");

    // Generate two gaussian distributions of different variance
    Normaldev ndev = new Normaldev(0.0,1.0,17);
    for (i=0;i<NPTS;i++) data1[i]=ndev.dev();
    avevar(data1,ave1,var1);
    for (i=0;i<NPTS;i++) data1[i] -= ave1.val;
    // Conclass data with exactly twice the standard deviation
    for (i=0;i<NPTS;i++) data2[i]=NSHFT/2.0*EPS+2.0*data1[i];
    avevar(data2,ave2,var2);
//    System.out.printf(ave1 << " %f\n", ave2 << " %f\n", var1 << " %f\n", var2);
    sd=sqrt((var1.val+var2.val)/NPTS);
    for (i=0;i<NSHFT+1;i++) {
      doubleW tw = new doubleW(0);
      doubleW pw = new doubleW(0);
      tutest(data1,data2,tw, pw); t[i]=tw.val;prob[i]=pw.val;
      for (j=0;j<NPTS;j++) data1[j] += EPS;
      tt[i]=(-NSHFT/2.0+i)*EPS/sd;
//      System.out.printf(t[i] << " %f\n", prob[i] << " %f\n", tt[i]);
    }
View Full Code Here

    // Test sncndn
    System.out.println("Testing sncndn");

    for (i=0;i<N;i++) {
      doubleW sn = new doubleW(zz1[i]);
      doubleW cn = new doubleW(zz2[i]);
      doubleW dn = new doubleW(zz3[i]);
      sncndn(u[i],1.0-ksquare[i],sn, cn, dn); // zz1[i],zz2[i],zz3[i]
      zz1[i] = sn.val; zz2[i] = cn.val; zz3[i] = dn.val;
     
      test1[i]=SQR(zz1[i])+SQR(zz2[i]);
      test2[i]=ksquare[i]*SQR(zz1[i])+ SQR(zz3[i]);
View Full Code Here

  @SuppressWarnings("unused")
  @Test
  public void test() {
    int i,j,ntotal,NTYPE=9,NMON=12;
    double sbeps;
    doubleW chisq=new doubleW(0),prob = new  doubleW(0),df =new doubleW(0);
    doubleW ccc=new doubleW(0),cramrv = new doubleW(0);
   
    double mydf,mychisq,mycramerv,myconting,myprob;
    String title="Accidental Deaths by Month and Type";
    String month[]={"jan","feb","mar","apr","may","jun",
      "jul","aug","sep","oct","nov","dec"};
View Full Code Here

  }

  @Test
  public void test() {
    int i,j,NPTS=10000,NSHFT=10;
    doubleW ave1=new doubleW(0),ave2 = new doubleW(0);
    doubleW var1 = new doubleW(0), var2 = new doubleW(0);
    double cov,sd,EPS=0.01,sbeps;
    double fingerprint[]={0.012206481763442537,0.044962205835956524,
      0.13262719786074151,0.31606378510286803,0.61616056459021917,
      1.0,0.61616056459021917,0.31606378510286803,0.13262719786074151,
      0.044962205835956524,0.012206481763442537};
    double[] data1=new double[NPTS],data2=new double[NPTS];
    double[] t=new double[NSHFT+1],prob=new double[NSHFT+1],texpect= new double[NSHFT+1];
    double[] fp=buildVector(fingerprint);
    boolean localflag=false,globalflag=false;

   

    // Test tptest
    System.out.println("Testing tptest");

    Normaldev ndev = new Normaldev(0.0,1.0,17);
    // Generate identical data but with a shift
    for (j=0;j<NPTS;j++) data1[j]=ndev.dev();
    avevar(data1,ave1,var1);
    for (j=0;j<NPTS;j++) {
      data1[j] -= ave1.val;
      data2[j] = -data1[j];
      data1[j] -= (NSHFT/2.0)*EPS;
    }
    avevar(data1,ave1,var1);
    avevar(data2,ave2,var2);
    cov=-var1.val;
    sd=sqrt((2.0*var1.val-2.0*cov)/NPTS);
    for (i=0;i<NSHFT+1;i++) {
      doubleW tw = new doubleW(0);
      doubleW pw = new doubleW(0);
      tptest(data1,data2,tw,pw);t[i]=tw.val;prob[i]=pw.val;
      texpect[i]=(-NSHFT/2.0+i)*EPS/sd;
//      System.out.printf(setprecision(20) << t[i] << " %f\n", prob[i] << " %f\n", texpect[i]);
      for (j=0;j<NPTS;j++) data1[j] += EPS;
    }
View Full Code Here

  @Test
  public void test() {
    int NBINS=10,NPTS=10000;
    int i,ibin;
    doubleW chsq=new doubleW(0),prob = new  doubleW(0),df =new doubleW(0);
    double x;
    double[] bins1=new double[NBINS],bins2=new double[NBINS];
    boolean localflag=false,globalflag=false;

   
View Full Code Here

TOP

Related Classes of org.netlib.util.doubleW

Copyright © 2018 www.massapicom. 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.