24package umontreal.ssj.discrepancy;
26import umontreal.ssj.hups.PointSet;
57 public double compute(
double[][] points,
int n,
int s,
double[] gamma) {
100 public double compute(
double[][] points,
int n,
int s) {
102 for (
int i = 0; i < n; ++i) {
104 for (
int j = 0; j < s; ++j) {
105 double u = 0.5 - points[i][j];
106 prod *= 1.5 - 2.0 * u * u;
110 double disc = -2.0 * sum / n;
114 for (
int i = 0; i < n - 1; ++i) {
115 for (
int j = i + 1; j < n; ++j) {
117 for (
int k = 0; k < s; ++k)
118 prod *= 1.0 - Math.abs(points[i][k] - points[j][k]);
123 disc += (sum + 2.0 * sum2) * Math.pow(2.0, s) / ((long) n * n);
124 disc += Math.pow(4.0 / 3.0, s);
127 return Math.sqrt(disc);
139 for (
int i = 0; i < n; ++i)
140 sum += T[i] * (1.0 - T[i]);
141 double disc = -4.0 * sum / n;
144 for (
int i = 0; i < n - 1; ++i) {
145 for (
int j = i + 1; j < n; ++j)
146 sum += Math.abs(T[i] - T[j]);
149 disc -= 4.0 * sum / ((long) n * n);
153 return Math.sqrt(disc);
double compute(double[] T, int n)
Computes the -symmetric discrepancy for the set of 1-dimensional points.
DiscL2Symmetric(int n, int s)
Constructor with points in dimension .
double compute(double[][] points, int n, int s)
Computes the -symmetric discrepancy for the set of -dimensional points points, using formula ( sym )...
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.
DiscL2Symmetric()
Empty constructor.
DiscL2Symmetric(double[][] points, int n, int s)
Constructor with the points points[i] in dimensions.
DiscL2Symmetric(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.