SSJ
3.3.1
Stochastic Simulation in Java
|
This class computes the discrepancy for randomly shifted points of a set \(\mathcal{P}\) [84] (eq. More...
Public Member Functions | |
DiscShift1 (double[][] points, int n, int s) | |
Constructor with the \(n\) points points[i] in \(s\) dimensions and with all weights \(\gamma_r =1\). More... | |
DiscShift1 (double[][] points, int n, int s, double[] gamma) | |
Constructor with the \(n\) points points[i] in \(s\) dimensions, and with the weights \(\gamma_r = \) gamma[r-1] , \(r = 1, …, s\). More... | |
DiscShift1 (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)\). More... | |
DiscShift1 (PointSet set) | |
Constructor with the point set set . More... | |
DiscShift1 () | |
Empty constructor. More... | |
double | compute (double[][] points, int n, int s) |
Computes the discrepancy ( shift1 ) for the first \(n\) points of set points in dimension \(s\). More... | |
double | compute (double[][] points, int n, int s, double[] gamma) |
Computes the discrepancy ( shift1 ) in dimension \(s\) with \(\gamma_r = \) gamma[r-1] . | |
double | compute (double[] T, int n) |
Computes the discrepancy ( shift1dim1 ) for the 1-dimensional set of \(n\) points \(T\). | |
Public Member Functions inherited from Discrepancy | |
Discrepancy (double[][] points, int n, int s) | |
Constructor with the \(n\) points points[i] in \(s\) dimensions. More... | |
Discrepancy (double[][] points, int n, int s, double[] gamma) | |
Constructor with the \(n\) points points[i] in \(s\) dimensions and the \(s\) weight factors gamma[ \(j\)] , \(j = 0, 1, …, (s-1)\). More... | |
Discrepancy (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)\). More... | |
Discrepancy (PointSet set) | |
Constructor with the point set set . More... | |
Discrepancy () | |
Empty constructor. More... | |
double | compute () |
Computes the discrepancy of all the points in maximal dimension (dimension of the points). | |
double | compute (int s) |
Computes the discrepancy of all the points in dimension \(s\). | |
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 . | |
abstract double | compute (double[][] points, int n, int s) |
Computes the discrepancy of the first n points of points in dimension s with weights \(=1\). | |
double | compute (double[][] points) |
Computes the discrepancy of all the points of points in maximum dimension. More... | |
double | compute (double[] T, int n) |
Computes the discrepancy of the first n points of T in 1 dimension. More... | |
double | compute (double[] T) |
Computes the discrepancy of all the points of T in 1 dimension. More... | |
double | compute (double[] T, int n, double gamma) |
Computes the discrepancy of the first n points of T in 1 dimension with weight gamma . | |
double | compute (PointSet set, double[] gamma) |
Computes the discrepancy of all the points in set in the same dimension as the point set and with weights gamma . | |
double | compute (PointSet set) |
Computes the discrepancy of all the points in set in the same dimension as the point set. More... | |
int | getNumPoints () |
Returns the number of points \(n\). | |
int | getDimension () |
Returns the dimension of the points \(s\). | |
void | setPoints (double[][] points, int n, int s) |
Sets the points to points and the dimension to \(s\). More... | |
void | setPoints (double[][] points) |
Sets the points to points . More... | |
void | setGamma (double[] gam, int s) |
Sets the weight factors to gam for each dimension up to \(s\). | |
double [] | getGamma () |
Returns the weight factors gamma for each dimension up to \(s\). | |
String | toString () |
Returns the parameters of this class. | |
String | formatPoints () |
Returns all the points of this class. | |
String | getName () |
Returns the name of the Discrepancy. | |
Static Protected Member Functions | |
static void | setC (double[] C1, double[] gam, int s) |
Static Protected Member Functions inherited from Discrepancy | |
static void | setONES (int s) |
Additional Inherited Members | |
Static Public Member Functions inherited from Discrepancy | |
static double [][] | toArray (PointSet set) |
Returns all the \(n\) points ( \(s\)-dimensional) of umontreal.ssj.hups.PointSet set as an array points[ \(n\)][ \(s\)] . | |
static DoubleArrayList | sort (double[] T, int n) |
Sorts the first \(n\) points of \(T\). More... | |
Protected Member Functions inherited from Discrepancy | |
void | appendGamma (StringBuffer sb, double[] gamma, int s) |
Protected Attributes inherited from Discrepancy | |
double [] | gamma |
double [][] | Points |
int | dim |
int | numPoints |
Static Protected Attributes inherited from Discrepancy | |
static double [] | ONES = { 1 } |
Static Package Attributes inherited from Discrepancy | |
static final double | UNSIX = 1.0/6.0 |
static final double | QUARAN = 1.0/42.0 |
static final double | UNTRENTE = 1.0 / 30.0 |
static final double | DTIERS = 2.0 / 3.0 |
static final double | STIERS = 7.0 / 3.0 |
static final double | QTIERS = 14.0 / 3.0 |
This class computes the discrepancy for randomly shifted points of a set \(\mathcal{P}\) [84] (eq.
\[ [\mathcal{D}(\mathcal{P})]^2 = -1 + \frac{1}{n^2} \sum_{i=1}^n\sum_{j=1}^n \prod_{r=1}^s \left[1 + \gamma_r^2 B_2(\{x_{ir} - x_{jr}\})\right], \tag{shift1} \]
where \(n\) is the number of points of \(\mathcal{P}\), \(s\) is the dimension of the points, \(x_{ir}\) is the \(r\)-th coordinate of point \(i\), and the \(\gamma_r\) are arbitrary positive weights. The \(B_{\alpha}(x)\) are the Bernoulli polynomials [1] (chap. 23) of degree \(\alpha\) (see umontreal.ssj.util.Num.bernoulliPoly in class util/Num
), and the notation \(\{x\}\) means the fractional part of \(x\), defined here as \(\{x\} = x \bmod1\). In one dimension, the formula simplifies to
\[ [\mathcal{D}(\mathcal{P})]^2 = \frac{1}{n^2} \sum_{i=1}^n\sum_{j=1}^n B_2(\{x_i - x_j\}), \tag{shift1dim1} \]
where \(z_i\) is the point \(i\).
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 \(\mathcal{H}\) with a reproducing kernel \(K\) given by
\[ K(\mathbf{x},\mathbf{y}) = \prod_{r=1}^s \left[ \frac{\gamma_r^2}{2} B_2(\{x_r-y_r\}) + \sum_{\alpha=0}^1 \gamma_r^{2\alpha} B_{\alpha}(x_r)B_{\alpha}(y_r) \right], \]
The norm of the vectors in \(\mathcal{H}\) is defined by
\[ \| f\|^2 = \sum_{u \subseteq S} \gamma_u^{-2} \int_{[0,1]^u}d\mathbf{x}_u\left[\int_{[0,1]^{S-u}} \frac{\partial^{|u|}f}{\partial\mathbf{x}_u}d\mathbf{x}_{S-u} \right]^2, \]
where \(S= \{1, …, s\}\) is a set of coordinate indices, \(u \subseteq S\), and \(\gamma_u = \prod_{r\in u} \gamma_r\).
DiscShift1 | ( | double | points[][], |
int | n, | ||
int | s | ||
) |
Constructor with the \(n\) points points[i]
in \(s\) dimensions and with all weights \(\gamma_r =1\).
points[i][j]
is the j
-th coordinate of point i
. Indices i
and j
start at 0.
DiscShift1 | ( | double | points[][], |
int | n, | ||
int | s, | ||
double [] | gamma | ||
) |
Constructor with the \(n\) points points[i]
in \(s\) dimensions, and with the weights \(\gamma_r = \) gamma[r-1]
, \(r = 1, …, s\).
points[i][j]
is the j
-th coordinate of point i
. Indices i
and j
start at 0.
DiscShift1 | ( | 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.
DiscShift1 | ( | PointSet | set | ) |
Constructor with the point set set
.
All the points are copied in an internal array.
DiscShift1 | ( | ) |
Empty constructor.
One must set the points, the dimension, and the weight factors before calling any method.
double compute | ( | double | points[][], |
int | n, | ||
int | s | ||
) |
Computes the discrepancy ( shift1 ) for the first \(n\) points of set points
in dimension \(s\).
All weights \(\gamma_r = 1\).