SSJ
V. labo.

umontreal.iro.lecuyer.discrepancy
Class DiscShift2

java.lang.Object
  extended by umontreal.iro.lecuyer.discrepancy.Discrepancy
      extended by umontreal.iro.lecuyer.discrepancy.DiscShift2
Direct Known Subclasses:
DiscShift2Lattice

public class DiscShift2
extends Discrepancy

This class computes the discrepancy in for the randomly shifted points of a set P. It is given by

[D(P)]2 = - 1 + $\displaystyle {\frac{{1}}{{n^2}}}$i=1nj=1nr=1s[1 + $\displaystyle {\frac{{\gamma_r^2}}{{2}}}$B2({xir - xjr}) - $\displaystyle {\frac{{\gamma_r^4}}{{12}}}$B4({xir - xjr})],

where n is the number of points of P, s is the dimension of the points, xir is the r-th coordinate of point i, and the γr are arbitrary positive weights. The Bα(x) are the Bernoulli polynomials of degree α (see bernoulliPoly in class util/Num). The notation {x} means the fractional part of x, defined as {x} = x mod 1. In one dimension, the formula simplifies to

[D(P)]2 = [tex2html_wrap_indisplay320]∑i=1nj=1n[$\displaystyle {\frac{{\gamma^2}}{{2}}}$B2({xi - xj}) - $\displaystyle {\frac{{\gamma^4}}{{12}}}$B4({xi - xj})].

The discrepancy represents a worst-case error criterion for the approximation of integrals, when the integrands have a certain degree of smoothness and lie in a Hilbert space H with a reproducing kernel K given by

K(x,y) = ∏r=1s[- $\displaystyle {\frac{{\gamma_r^4}}{{4!}}}$B4({xr - yr}) + ∑α=02$\displaystyle {\frac{{\gamma_r^{2\alpha}}}{{(\alpha!)^2}}}$Bα(xr)Bα(yr)],

The norm of the vectors in H is defined by

| f|2 = ∑u⊆Sv⊆uγu-2γv-2[0, 1]vdxv[∫[0, 1]S-v$\displaystyle {\frac{{\partial^{\vert u\vert + \vert v\vert}f}}{{\partial\mathbf{x}_u\partial\mathbf{x}_v}}}$dxS-v]2,

where S = {1,…, s} is a set of coordinate indices, uS, and γu = ∏r∈uγr.


Constructor Summary
DiscShift2()
          Empty constructor.
DiscShift2(double[][] points, int n, int s)
          Constructor with the n points Pi = points[i] in dimension s, with all weights γj = 1.
DiscShift2(double[][] points, int n, int s, double[] gamma)
          Constructor with the n points Pi = points[i] in dimension s, with the weights γj = gamma[j-1], j = 1,…, s.
DiscShift2(int n, int s, double[] gamma)
          The number of points is n, the dimension s, and the s weight factors are gamma[j], j = 0, 1,…,(s - 1).
DiscShift2(PointSet set)
          Constructor with the point set set.
 
Method Summary
 double compute(double[][] points, int n, int s)
          Computes the discrepancy for the first n points of set points in dimension s.
 double compute(double[][] points, int n, int s, double[] gamma)
          Computes the discrepancy for the first n points of set points in dimension s and with weight γr = gamma[r-1].
 double compute(double[] T, int n)
          Computes the discrepancy for the first n points of T in 1 dimension, with weight γ = 1.
 double compute(double[] T, int n, double gamma)
          Computes the discrepancy for the first n points of T in 1 dimension, with weight γ = gamma.
 
Methods inherited from class umontreal.iro.lecuyer.discrepancy.Discrepancy
compute, compute, compute, compute, compute, compute, formatPoints, getDimension, getGamma, getName, getNumPoints, setGamma, setPoints, setPoints, sort, toArray, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DiscShift2

public DiscShift2(double[][] points,
                  int n,
                  int s)
Constructor with the n points Pi = points[i] in dimension s, with all weights γj = 1. points[i][j] is the j-th coordinate of point i. Both indices i and j starts at 0.


DiscShift2

public DiscShift2(double[][] points,
                  int n,
                  int s,
                  double[] gamma)
Constructor with the n points Pi = points[i] in dimension s, with the weights γj = gamma[j-1], j = 1,…, s. points[i][j] is the j-th coordinate of point i. Both indices i and j starts at 0.


DiscShift2

public DiscShift2(int n,
                  int s,
                  double[] gamma)
The number of points is n, the dimension s, and the s weight factors are gamma[j], j = 0, 1,…,(s - 1). The n points will be chosen later.


DiscShift2

public DiscShift2(PointSet set)
Constructor with the point set set. All the points are copied in an internal array.


DiscShift2

public DiscShift2()
Empty constructor. One must set the points, the dimension, and the weight factors before calling any method.

Method Detail

compute

public double compute(double[][] points,
                      int n,
                      int s)
Computes the discrepancy for the first n points of set points in dimension s. All weights γr = 1.

Specified by:
compute in class Discrepancy

compute

public double compute(double[][] points,
                      int n,
                      int s,
                      double[] gamma)
Computes the discrepancy for the first n points of set points in dimension s and with weight γr = gamma[r-1].

Overrides:
compute in class Discrepancy

compute

public double compute(double[] T,
                      int n)
Computes the discrepancy for the first n points of T in 1 dimension, with weight γ = 1.

Overrides:
compute in class Discrepancy

compute

public double compute(double[] T,
                      int n,
                      double gamma)
Computes the discrepancy for the first n points of T in 1 dimension, with weight γ = gamma.

Overrides:
compute in class Discrepancy

SSJ
V. labo.

To submit a bug or ask questions, send an e-mail to Pierre L'Ecuyer.