g05ym Method
関数リスト一覧   NagLibrary Namespaceへ  ライブラリイントロダクション  本ヘルプドキュメントのchm形式版

g05ym generates a uniformly distributed low-discrepancy sequence as proposed by Sobol, Faure or Niederreiter. It must be preceded by a call to one of the initialization routines g05yl or g05yn.


public static void g05ym(
	int n,
	int rcord,
	double[,] quas,
	int[] iref,
	out int ifail
Visual Basic (Declaration)
Public Shared Sub g05ym ( _
	n As Integer, _
	rcord As Integer, _
	quas As Double(,), _
	iref As Integer(), _
	<OutAttribute> ByRef ifail As Integer _
Visual C++
static void g05ym(
	int n, 
	int rcord, 
	array<double,2>^ quas, 
	array<int>^ iref, 
	[OutAttribute] int% ifail
static member g05ym : 
        n:int * 
        rcord:int * 
        quas:float[,] * 
        iref:int[] * 
        ifail:int byref -> unit 


Type: System..::.Int32
On entry: the number of quasi-random numbers required.
Constraint: n0 and n+previous number of generated values230 
Type: System..::.Int32
On entry: the order in which the generated values are returned.
Constraint: rcord=1 or 2.
Type: array< System..::.Double ,2>[,](,)[,]
An array of size [ldquas, sdquas]
Note: ldquas must satisfy the constraint:
  • if rcord=1, ldquasidim;
  • if rcord=2, ldquasn.
On exit: contains the n quasi-random numbers of dimension idim.
If rcord=1, quas[i-1,j-1] holds the jth value for the ith dimension.
If rcord=2, quas[i-1,j-1] holds the ith value for the jth dimension.
Type: array< System..::.Int32 >[]()[]
An array of size [liref]
On entry: contains information on the current state of the sequence.
On exit: contains updated information on the state of the sequence.
Type: System..::.Int32 %
On exit: ifail=0 unless the method detects an error (see [Error Indicators and Warnings]).


Note: the following variables are used in the parameter descriptions:


Low discrepancy (quasi-random) sequences are used in numerical integration, simulation and optimization. Like pseudorandom numbers they are uniformly distributed but they are not statistically independent, rather they are designed to give more even distribution in multidimensional space (uniformity). Therefore they are often more efficient than pseudorandom numbers in multidimensional Monte–Carlo methods.
g05ym generates a set of points x1,x2,,xN with high uniformity in the S-dimensional unit cube IS=0,1S.
Let G be a subset of IS and define the counting function SNG as the number of points xiG. For each x=x1,x2,,xSIS, let Gx be the rectangular S-dimensional region
G x = 0, x 1 × 0, x 2 ×× 0, x S
with volume x1,x2,,xS. Then one measure of the uniformity of the points x1,x2,,xN is the discrepancy:
DN* x1,x2,,xN = sup xIS SN Gx - N x1 , x2 , , xS .
which has the form
DN*x1,x2,,xNCSlogNS+OlogNS-1  for all  N2.
The principal aim in the construction of low-discrepancy sequences is to find sequences of points in IS with a bound of this form where the constant CS is as small as possible.
The type of low-discrepancy sequence generated by g05ym depends on the initialization method called and can include those proposed by Sobol, Faure or Niederreiter. If the initialization method g05yn was used then the sequence will be scrambled (see [Section ] in g05yn for details).


Error Indicators and Warnings


Further Comments


This example calls g05yl and g05ym to estimate the value of the integral
01 01 i=1 s 4xi-2 dx1, dx2, , dxs = 1 .
In this example the number of dimensions S is set to 8.

Example program (C#): g05yme.cs

Example program results: g05yme.r

See Also