8 static double lnbeta(
double a,
double b)
28 if (y<0.0 || y>1.0 || a<=0.0 || b<=0.0 )
30 cerr <<
"Illegal value in inv_cumd_beta" <<
endl;
45 double s=
log(x/(1.0-x));
46 double lower=
log(eps/eps1);
50 double denom=1.0/(
betai(a,b,eps1)-
betai(a,b,eps));
51 double finit=
betai(a,b,x)-
betai(a,b,eps)*denom;
87 double xa1=
pow(x,a-1);
91 double fp=(xa1*xb1/bet)*dx*denom;
99 s=lower+0.5*(s-lower);
112 if (icount>15)
break;
114 while(
fabs(d)>1.e-12);
125 if (y<0.0 || y>1.0 || a<=0.0 || b<=0.0 )
127 cerr <<
"Illegal value in inv_cumd_beta" <<
endl;
128 cerr<<
"y: "<<y<<
endl;
129 cerr<<
"a: "<<a<<
endl;
130 cerr<<
"b: "<<b<<
endl;
141 double finit=
betai(a,b,x);
170 double xa1=
pow(x,a-1);
171 double xb1=
pow(1-x,b-1);
173 double fp=(xa1*xb1/bet);
180 x=lower+0.5*(x-lower);
193 if (icount>50)
break;
195 while(
fabs(d)>1.e-16);
double gammln(double xx)
Log gamma function.
double qbeta(double x, double a, double b, double eps)
double old_inv_cumd_beta_stable(double a, double b, double y, double eps)
df1_two_variable fabs(const df1_two_variable &x)
double inv_cumd_beta_stable(double a, double b, double y, double eps)
prnstream & endl(prnstream &)
Description not yet available.
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.
static double lnbeta(double a, double b)
double square(const double value)
Return square of value; constant object.
d3_array log(const d3_array &arr3)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
d3_array pow(const d3_array &m, int e)
Description not yet available.