Examples of dev()


Examples of com.nr.ran.Gammadev.dev()

    t=0.0;
    for (i=0;i<N;i++) {
      if (t < tc) {
        t += gdev1.dev();
      } else {
        t += gdev2.dev();
      }
      times[i]=t;
    }

    State s=new State(1.0,3.0,100.0,1,1);
View Full Code Here

Examples of com.nr.ran.Gammadev.dev()

    beta=1.0;
    Gammadev myran=new Gammadev(alpha,beta,17);
    localflag=false;
    for (i=0;i<10;i++)
//      System.out.printf(setw(25) << setprecision(20) << myran.dev());
      localflag=localflag || abs(myran.dev()-fingerprint[i])>sbeps;
    globalflag = globalflag || localflag;
    if (localflag) {
      fail("*** Gammadev: dev() does not match fingerprint");
     
    }
View Full Code Here

Examples of com.nr.ran.Gammadev.dev()

      x[i]=binsize*i;
      ebins[i]=N*binsize*expect.p(x[i]+0.5*binsize);
      bins[i]=0;
    }
    for (i=0;i<N;i++) {
      nbin=(int)(floor(myran.dev()/binsize));
      if ((nbin >= 0) && (nbin < M)) bins[nbin] += 1;
    }
    chsone(bins,ebins,df,chisq,prob);
    System.out.printf("     chisq,dev(): %f  prob: %f\n",chisq.val, prob.val);
    localflag = (prob.val < 0.05);
View Full Code Here

Examples of com.nr.ran.Logisticdev.dev()

    sig=1.0;
    Logisticdev myran = new Logisticdev(mu,sig,17);
    localflag=false;
    for (i=0;i<10;i++)
//      System.out.printf(setw(25) << setprecision(20) << myran.dev());
      localflag=localflag || abs(myran.dev()-fingerprint[i])>sbeps;
    globalflag = globalflag || localflag;
    if (localflag) {
      fail("*** Logisticdev: dev() does not match fingerprint");
     
    }
View Full Code Here

Examples of com.nr.ran.Logisticdev.dev()

      x[i]=xl+binsize*i;
      ebins[i]=N*binsize*expect.p(x[i]+0.5*binsize);
      bins[i]=0;
    }
    for (i=0;i<N;i++) {
      nbin=(int)(floor((0.5*range+myran.dev())/binsize));
      if ((nbin >= 0) && (nbin < M)) bins[nbin] += 1;
    }
    chsone(bins,ebins,df,chisq,prob);
    System.out.printf("     chisq,dev(): %f  prob: %f\n", chisq.val, prob.val);
    localflag = (prob.val < 0.05);
View Full Code Here

Examples of com.nr.ran.Multinormaldev.dev()

    System.out.println("Testing Multinormaldev");

    Multinormaldev multi =new Multinormaldev(17L,mean,covar);

    for (i=0;i<N;i++) {
      a=multi.dev();
      x[i]=a[0];
      y[i]=a[1];
      z[i]=a[2];
    }
View Full Code Here

Examples of com.nr.ran.Normaldev.dev()

    System.out.println("Testing ttest");

    // Generate gaussian distributed data
    Normaldev ndev=new Normaldev(0.0,1.0,17);
    // Special case: identical distributions
    for (i=0;i<NPTS;i++) data1[i]=ndev.dev();
    for (i=0;i<NPTS;i++) data2[i]=(NSHFT/2.0)*EPS+data1[i];
    avevar(data1,ave1,var1);
    avevar(data2,ave2,var2);
    sd=sqrt(var1.val/NPTS*2.0);
    for (i=0;i<NSHFT+1;i++) {
View Full Code Here

Examples of com.nr.ran.Normaldev.dev()

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

    // Generate two gaussian distributions with different variances
    Normaldev ndev=new Normaldev(0.0,1.0,17);
    for (j=0;j<NPTS;j++) data1[j]=ndev.dev();
    avevar(data1,ave1,var1);
    for (j=0;j<NPTS;j++) data1[j] -= ave1.val;
    for (j=0;j<NPTS;j++) data2[j]=data1[j];
    ftest(data1,data2,f,prob);
//    System.out.printf(1.0-prob << " %f\n", 1.0-f);
View Full Code Here

Examples of com.nr.ran.Normaldev.dev()

    // 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);
View Full Code Here

Examples of com.nr.ran.Normaldev.dev()

    // 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;
 
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.