|
static double | bernoulli (double p, double q) |
|
static double | beta (double alpha, double beta, double q) |
|
static int | binomial (int n, double p, double q) |
|
static double | cauchy (double median, double scale, double q) |
|
static double | chiSquared (int df, double q) |
|
static double | exponential (double lambda, double q) |
|
static double | f (int df1, int df2, double q) |
|
static double | gamma (double shape, double scale, double q) |
|
static double | inverseGamma (double shape, double q) |
|
Definition at line 42 of file quantiles.cpp.
◆ bernoulli()
static double Quantile::bernoulli |
( |
double |
p, |
|
|
double |
q |
|
) |
| |
|
inlinestatic |
Definition at line 45 of file quantiles.cpp.
46 return (q < p) ? 0.0 : 1.0;
◆ beta()
static double Quantile::beta |
( |
double |
alpha, |
|
|
double |
beta, |
|
|
double |
q |
|
) |
| |
|
inlinestatic |
Definition at line 50 of file quantiles.cpp.
static double beta(double alpha, double beta, double q)
static double incompleteBeta(double a, double b, double x)
References incompleteBeta().
◆ betaContinuedFraction()
static double Quantile::betaContinuedFraction |
( |
double |
a, |
|
|
double |
b, |
|
|
double |
x |
|
) |
| |
|
inlinestaticprivate |
Definition at line 154 of file quantiles.cpp.
155 const int maxIterations = 200;
156 const double epsilon = 1.0e-15;
162 double qap = a + 1.0;
163 double qam = a - 1.0;
164 double bz = 1.0 - qab * x / qap;
166 double em, tem, d, ap, bp, app, bpp;
169 for (m = 1; m <= maxIterations; m++) {
172 d = em * (b - m) * x / ((qam + tem) * (a + tem));
175 d = -(a + em) * (qab + em) * x / ((a + tem) * (qap + tem));
184 if (fabs(az - aold) < (epsilon * fabs(az)))
Referenced by incompleteBeta().
◆ binomial()
static int Quantile::binomial |
( |
int |
n, |
|
|
double |
p, |
|
|
double |
q |
|
) |
| |
|
inlinestatic |
◆ binomialCoefficient()
static int Quantile::binomialCoefficient |
( |
int |
n, |
|
|
int |
k |
|
) |
| |
|
inlinestaticprivate |
Definition at line 194 of file quantiles.cpp.
197 if (k == 0 || k == n)
204 for (
int i = 0; i < k; ++i) {
Referenced by binomial().
◆ cauchy()
static double Quantile::cauchy |
( |
double |
median, |
|
|
double |
scale, |
|
|
double |
q |
|
) |
| |
|
inlinestatic |
Definition at line 79 of file quantiles.cpp.
80 return median + scale * tan(M_PI * (q - 0.5));
◆ chiSquared()
static double Quantile::chiSquared |
( |
int |
df, |
|
|
double |
q |
|
) |
| |
|
inlinestatic |
Definition at line 84 of file quantiles.cpp.
85 if (q < 0.0 || q > 1.0 || df < 1)
static double inverseGamma(double shape, double q)
References inverseGamma().
◆ exponential()
static double Quantile::exponential |
( |
double |
lambda, |
|
|
double |
q |
|
) |
| |
|
inlinestatic |
Definition at line 91 of file quantiles.cpp.
92 if (q < 0.0 || q > 1.0 || lambda <= 0.0)
94 return -log(1.0 - q) / lambda;
◆ f()
static double Quantile::f |
( |
int |
df1, |
|
|
int |
df2, |
|
|
double |
q |
|
) |
| |
|
inlinestatic |
Definition at line 98 of file quantiles.cpp.
99 if (q <= 0.0 || q >= 1.0 || df1 <= 0 || df2 <= 0)
101 return (
inverseBeta(0.5 * df2, 0.5 * df1, q) * df2) /
102 (
inverseBeta(0.5 * df2, 0.5 * df1, 1.0 - q) * df1);
static double inverseBeta(double a, double b, double q)
References inverseBeta().
◆ gamma()
static double Quantile::gamma |
( |
double |
shape, |
|
|
double |
scale, |
|
|
double |
q |
|
) |
| |
|
inlinestatic |
◆ gammaLn()
static double Quantile::gammaLn |
( |
double |
xx | ) |
|
|
inlinestaticprivate |
Definition at line 135 of file quantiles.cpp.
136 double x, y, tmp, ser;
137 static const double cof[6] = {76.18009172947146,
141 0.1208650973866179e-2,
142 -0.5395239384953e-5};
147 tmp -= (x + 0.5) * log(tmp);
148 ser = 1.000000000190015;
149 for (j = 0; j < 6; j++)
151 return -tmp + log(2.5066282746310005 * ser / x);
Referenced by incompleteBeta().
◆ incompleteBeta()
static double Quantile::incompleteBeta |
( |
double |
a, |
|
|
double |
b, |
|
|
double |
x |
|
) |
| |
|
inlinestaticprivate |
Definition at line 120 of file quantiles.cpp.
121 const int maxIterations = 200;
122 const double epsilon = 1.0e-15;
124 double bt = (x == 0.0 || x == 1.0)
127 a * log(x) + b * log(1.0 - x));
129 if (x < (a + 1.0) / (a + b + 2.0))
static double gammaLn(double xx)
static double betaContinuedFraction(double a, double b, double x)
References betaContinuedFraction(), and gammaLn().
Referenced by beta(), and inverseBeta().
◆ inverseBeta()
static double Quantile::inverseBeta |
( |
double |
a, |
|
|
double |
b, |
|
|
double |
q |
|
) |
| |
|
inlinestaticprivate |
◆ inverseGamma()
static double Quantile::inverseGamma |
( |
double |
shape, |
|
|
double |
q |
|
) |
| |
|
inlinestatic |
Definition at line 113 of file quantiles.cpp.
114 if (q < 0.0 || q > 1.0 || shape <= 0.0)
116 return 1.0 /
gamma(shape, 1.0 / shape, 1.0 - q);
static double gamma(double shape, double scale, double q)
References gamma().
Referenced by chiSquared(), and gamma().
The documentation for this class was generated from the following file: