27 if (x < 0.0 || x > 1.0) cerr <<
"Bad x in routine betai" <<
endl;
28 if (x == 0.0 || x == 1.0) bt=0.0;
31 if (x < (a+1.0)/(a+b+2.0))
32 return bt*
betacf(a,b,x,maxit)/a;
34 return 1.0-bt*
betacf(b,a,1.0-x,maxit)/b;
49 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)
Fundamental data type for reverse mode automatic differentiation.
d3_array log(const d3_array &arr3)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.