Examples of gammq()


Examples of com.nr.sf.Gamma.gammq()

      1.695040627613259e-1,5.420702855281473e-1,7.985688950544638e-1};
    double[] xx=buildVector(x),yy=buildVector(y),zz= new double[N],uu= new double[N],vv= new double[N],c=buildVector(N,1.);

    for (i=0;i<N;i++) {
      zz[i]=gam.gammp(a[i],x[i]);     // Test gammp
      uu[i]=gam.gammq(a[i],x[i]);     // Test gammq
      vv[i]=gam.invgammp(zz[i],a[i]);   // Test invgammp
    }

    System.out.printf("Gamma.gammp: Maximum discrepancy = %f\n", maxel(vecsub(zz,yy)));
    sbeps=5.e-15;
View Full Code Here

Examples of com.nr.sf.Gamma.gammq()

    double[] aa = new double[2],cc=buildVector(2,1.0);
    aa[0]=110.0; aa[1]=200.0;
    xx[0]=100.0; xx[1]=210.0;
    yy[0]=1.705598979081085e-1; yy[1]=7.639696745011632e-1;
    zz[0]=gam.gammp(aa[0],xx[0]); zz[1]=gam.gammp(aa[1],xx[1]);
    uu[0]=gam.gammq(aa[0],xx[0]); uu[1]=gam.gammq(aa[1],xx[1]);
    vv[0]=gam.invgammp(zz[0],aa[0]); vv[1]=gam.invgammp(zz[1],aa[1]);

    System.out.printf("Gamma.gammp from gammpapprox: Maximum discrepancy = %f\n", maxel(vecsub(zz,yy)));
    sbeps=5.e-14;
    localflag = maxel(vecsub(zz,yy)) > sbeps;
View Full Code Here

Examples of com.nr.sf.Gamma.gammq()

    double[] aa = new double[2],cc=buildVector(2,1.0);
    aa[0]=110.0; aa[1]=200.0;
    xx[0]=100.0; xx[1]=210.0;
    yy[0]=1.705598979081085e-1; yy[1]=7.639696745011632e-1;
    zz[0]=gam.gammp(aa[0],xx[0]); zz[1]=gam.gammp(aa[1],xx[1]);
    uu[0]=gam.gammq(aa[0],xx[0]); uu[1]=gam.gammq(aa[1],xx[1]);
    vv[0]=gam.invgammp(zz[0],aa[0]); vv[1]=gam.invgammp(zz[1],aa[1]);

    System.out.printf("Gamma.gammp from gammpapprox: Maximum discrepancy = %f\n", maxel(vecsub(zz,yy)));
    sbeps=5.e-14;
    localflag = maxel(vecsub(zz,yy)) > sbeps;
View Full Code Here

Examples of com.nr.sf.Gamma.gammq()

      }
    }
    mycramerv=sqrt(mychisq/ntotal/(NTYPE-1));
    myconting=sqrt(mychisq/(mychisq+ntotal));
    Gamma gam = new Gamma();
    myprob=gam.gammq(mydf/2.0,mychisq/2.0);

    cntab(table,chisq,df,prob,cramrv,ccc);

  /*
    System.out.printf(fixed << setprecision(4));
View Full Code Here

Examples of com.nr.sf.Gamma.gammq()

      } else {
        temp=bins[j]-ebins[j];
        chsq.val += temp*temp/ebins[j];
      }
    }
    prob.val=gam.gammq(0.5*df.val,0.5*chsq.val);
  }
 
  // Given the arrays bins1[0..nbins-1] and bins2[0..nbins-1], containing two sets of
  // binned data, and given the number of constraints knstrn (normally 1 or 0),
  // this routine returns the number of degrees of freedom df, the chi-square chsq,
View Full Code Here

Examples of com.nr.sf.Gamma.gammq()

        --df.val;
      else {
        temp=bins1[j]-bins2[j];
        chsq.val += temp*temp/(bins1[j]+bins2[j]);
      }
    prob.val=gam.gammq(0.5*df.val,0.5*chsq.val);
  }
 
 
  /*
   Given a two-dimensional contigency table in the form of an array nn[0..ni-1][0..nj-1] of
View Full Code Here

Examples of com.nr.sf.Gamma.gammq()

        expctd=sumj[j]*sumi[i]/sum;
        temp=nn[i][j]-expctd;
        chisq.val += temp*temp/(expctd+TINY);
      }
    }
    prob.val=gam.gammq(0.5*df.val,0.5*chisq.val);
    minij = nni < nnj ? nni-1 : nnj-1;
    cramrv.val=sqrt(chisq.val/(sum*minij));
    ccc.val=sqrt(chisq.val/(chisq.val+sum));
  }
 
View Full Code Here

Examples of com.nr.sf.Gamma.gammq()

    b /= st2;    // Solve for α, b, σ_α, and σ_b
    a=(sy-sx*b)/ss;
    siga=sqrt((1.0+sx*sx/(ss*st2))/ss);
    sigb=sqrt(1.0/st2);     // Calculate χ^2
    for (i=0;i<ndata;i++) chi2 += SQR((y[i]-a-b*x[i])/sig[i]);
    if (ndata>2) q=gam.gammq(0.5*(ndata-2),0.5*chi2);
  }

  // Constructor. As above, but without known errors (sig is not used). The uncertainties siga
  // and sigb are estimated by assuming equal errors for all points, and that a straight line is
  // a good fit. q is returned as 1.0, the normalization of chi2 is to unit standard deviation on all
View Full Code Here

Examples of com.nr.sf.Gamma.gammq()

    ang[0] = brent.ax; ang[1] = brent.bx; ang[2] = brent.cx;
    ch[0= brent.fa; ch[1= brent.fb; ch[2= brent.fc;
    b = brent.minimize(chixy);
    chi2=chixy.get(b);
    a=aa;
    q=gam.gammq(0.5*(ndat-2),chi2*0.5);
    r2=0.0;
    for (j=0;j<ndat;j++) r2 += ww[j];
    r2=1.0/r2;
    bmx=bmn=BIG;
    offs=chi2+1.0;
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.