21 double betai(
const double a,
const double b,
const double x,
int maxit)
25 if (x < 0.0 || x > 1.0) cerr <<
"Bad x in routine betai" <<
endl;
26 if (x == 0.0 || x == 1.0) bt=0.0;
29 if (x < (a+1.0)/(a+b+2.0))
30 return bt*
betacf(a,b,x,maxit)/a;
32 return 1.0-bt*
betacf(b,a,1.0-x,maxit)/b;
47 double pbeta(
const double x,
const double a,
const double b,
int maxit){
48 return betai(a,b,x,maxit);
double gammln(double xx)
Log gamma function.
double pbeta(const double x, const double a, const double b, int maxit)
beta distribution function for constant objects (alias of ibeta function with same arguments order as...
prnstream & endl(prnstream &)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
d3_array exp(const d3_array &arr3)
Returns d3_array results with computed exp from elements in arr3.
double betai(const double a, const double b, const double x, int maxit)
Incomplete beta function for constant objects.
Float betacf(Float a, Float b, Float x, int MAXIT)
d3_array log(const d3_array &arr3)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.