24package umontreal.ssj.discrepancy;
26import umontreal.ssj.hups.PointSet;
77 public double compute(
double[][] points,
int n,
int s,
double[] gamma) {
120 public double compute(
double[][] points,
int n,
int s) {
122 for (
int i = 0; i < n; ++i) {
124 for (
int j = 0; j < s; ++j) {
125 double u = points[i][j];
126 prod *= (1.0 - u) * (1.0 + u);
130 double disc = -Math.pow(0.5, (
double) (s - 1)) * sum / n;
133 for (
int i = 0; i < n; ++i) {
135 for (
int j = 0; j < s; ++j)
136 prod *= 1.0 - points[i][j];
141 for (
int i = 0; i < n - 1; ++i) {
142 for (
int j = i + 1; j < n; ++j) {
144 for (
int k = 0; k < s; ++k)
145 prod *= 1.0 - Math.max(points[i][k], points[j][k]);
150 disc += (sum + 2.0 * sum2) / ((
long) n * n);
151 disc += Math.pow(1.0 / 3.0, s);
154 return Math.sqrt(disc);
168 for (
int i = 0; i < n; i++) {
169 v = T[i] - (i + 0.5) / n;
172 W2 += 1.0 / (12.0 * n);
174 return Math.sqrt(W2 / n);
DiscL2Star(int n, int s)
Constructor with points in dimension .
DiscL2Star()
Empty constructor.
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.
double compute(double[] T, int n)
Computes the traditional -star discrepancy for the set of 1-dimensional points.
DiscL2Star(double[][] points, int n, int s)
Constructor with the points points[i] in dimension.
double compute(double[][] points, int n, int s)
Computes the traditional -star discrepancy ( discstar ) for the first points of points,...
DiscL2Star(PointSet set)
Constructor with the point set set.
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.