24package umontreal.ssj.discrepancy;
26import umontreal.ssj.hups.PointSet;
63 public double compute(
double[][] points,
int n,
int s,
double[] gamma) {
106 public double compute(
double[][] points,
int n,
int s) {
108 for (
int i = 0; i < n; ++i) {
110 for (
int k = 0; k < s; ++k)
111 prod *= points[i][k] * (1.0 - points[i][k]);
114 double disc = sum / n * (1.0 / n - Math.pow(0.5, (
double) (s - 1)));
117 for (
int i = 0; i < n - 1; ++i) {
118 for (
int j = i + 1; j < n; ++j) {
120 for (
int k = 0; k < s; ++k)
121 prod *= Math.min(points[i][k], points[j][k]) - points[i][k] * points[j][k];
126 disc += 2.0 * sum / ((long) n * n);
127 disc += Math.pow(1.0 / 12.0, s);
130 return Math.sqrt(disc);
142 for (
int i = 0; i < n; ++i)
143 sum += T[i] * (1.0 - T[i]);
144 double disc = -(1.0 - 1.0 / n) * sum / n;
147 for (
int i = 0; i < n - 1; ++i) {
148 for (
int j = i + 1; j < n; ++j)
149 sum2 += Math.min(T[i], T[j]) - T[i] * T[j];
152 disc += 2.0 * sum2 / ((long) n * n);
156 return Math.sqrt(disc);
double compute(double[][] points, int n, int s)
Computes the -unanchored discrepancy ( disc.unan ) for the set of -dimensional points points.
DiscL2Unanchored(double[][] points, int n, int s)
Constructor with the points points[i] in dimensions.
DiscL2Unanchored()
Empty constructor.
DiscL2Unanchored(PointSet set)
Constructor with the point set set.
double compute(double[][] points, int n, int s, double[] gamma)
Computes the discrepancy of the first n points of points in dimension s with weights gamma.
DiscL2Unanchored(int n, int s)
Constructor with points in dimension .
double compute(double[] T, int n)
Computes the -unanchored discrepancy for the 1-dimensional set of points.
Discrepancy(double[][] points, int n, int s)
Constructor with the points points[i] in dimensions.
double compute()
Computes the discrepancy of all the points in maximal dimension (dimension of the points).
This abstract class represents a general point set.