For a given population L, a parameter, e.g., θ, is estimated. In the Monte Carlo method, an estimate detector S(x) is first determined, in which x is a random variable with density function f
x
(x).
The estimate detector should satisfy the following two conditions:
-
(A)
The estimate detector should be unbiased.
$$ E\left[ {S(x)} \right] = \theta $$
-
(B)
The estimate detector should have definite variance.
$$ \text{var} \left( {S\left( x \right)} \right) = \sigma^{2} $$
Regarding the random samples X
1…. N
N
of the function, density of f
x
(x) is used.
$$ \hat{\theta }_{N} \left( {X_{1} \ldots X_{N} } \right) = \frac{1}{N}\sum\limits_{n = 1}^{N} {S(X_{n} } ) $$
(6)
$$ \text{var} (\hat{\theta }_{N} ) = \frac{{\sigma^{2} }}{N} < \infty ,\quad \quad E\left( {\hat{\theta }_{N} } \right) = \theta $$
We assume estimator number [6] as Monte Carlo estimator [6].
Monte Carlo simulation and stochastic differential equation
In this simulation, we present the expected value E[g(X(T))] for a solution, X, of a known stochastic differential equation with a known function of g. In general, bipartite approximation error contains two parts: random error and time discretization error. Statistical error estimate is based on the central limit theorem. Error estimation for the time-discretization error of the Euler method directly measures with one remained phrase the accuracy of \( \frac{1}{2} \) robust approximation.
Consider the following stochastic differential equation:
$$ {\text{d}}X\left( t \right) = a\left( {t,X\left( t \right)} \right) + b\left( {t,X\left( t \right)} \right){\text{d}}W(t). $$
How can the value of E[g(X(T))] be calculated on \( t_{0} \le t \le T \). Monte Carlo method is based on the approximation of
$$ E\left[ {g\left( {X\left( T \right)} \right)} \right] \cong \mathop \sum \limits_{j = 1}^{N} \frac{{g\left( {\bar{X}\left( {T;\omega_{j} } \right)} \right)}}{N} $$
where \( \mathop X\limits^{\_\_} \) is an approximation of X; according to Euler method, the error in the Monte Carlo method is
$$ E\left[ {g\left( {X\left( T \right)} \right)} \right] - \mathop \sum \limits_{j = 1}^{N} \frac{{g\left( {\bar{X}\left( {T;\omega_{j} } \right)} \right)}}{N} = E\left[ {g\left( {X\left( T \right)} \right) - g\left( {\bar{X}\left( T \right)} \right)} \right] - \mathop \sum \limits_{j = 1}^{N} \frac{{g\left( {\bar{X}\left( {T;\omega_{j} } \right)} \right) - E\left( {g\left( {\bar{X}\left( T \right)} \right)} \right)}}{N}. $$
Quasi-Monte Carlo (QMC)
The basic concept of quasi-Monte Carlo method is based on moving the random sample in Monte Carlo method with definite points accurately. The criterion of selection of definite points is that the sequence in [0,1)s has better uniformity than a random sequence. Indeed, these points should be such that [0,1)s is covered uniformly. To measure uniformity, a different concept is used as explained in the following definitions.
Definition 7.1
(estimation of quasi -Monte Carlo) Assume X
1, …, X
N
is selected of [∘, 1)s space, estimation of quasi-Monte Carlo is done as per the formula: \( \bar{I}_{\text{QMC}} = \frac{1}{N}\sum\nolimits_{i = 1}^{N} {f(X_{i} )} \).
In an ideal model, we replace the set of x
1,…, x
n
points with infinite sequence x
1, x
2,… in [0,1)s. A basic condition for this sequence is that the term \( \mathop {\lim }\limits_{N\, \to \,\infty } \frac{1}{N}\sum\nolimits_{n = 1}^{N} {f(X_{n} ) = \int_{{\,[ \circ \,,\,1)^{s} }} {f(x){\text{d}}x} } \) is satisfied.
The satisfaction of this term is achieved as sequence x
1, x
2, …, x
n
is distributed uniformly in [0,1)s. The difference, deviation scale of uniformity, is a sequence of points in [0,1)s.
Definition 7.2
(uniform distribution in [∘, 1)s) {X
n
}
n∊N
sequence is distributed uniformly in [∘, 1)s if for each x ∊ δ[∘, 1)s, we have
$$ \mathop {\lim }\limits_{N\, \to \,\infty } \frac{1}{N}\sum\limits_{n = 1}^{N} {f(X_{n} ) = \int_{{\,[ \circ \,,\,1)^{s} }} {f(x){\text{d}}x = I} } $$
Definition 7.3
(general discrepancy) Assume p is a set of points {X
1, …, X
N
}, and B is the family of subsets B ∊ [∘, 1)s. Then, the general discrepancy of set of points p = {X
1, …, X
N
} in interval [∘, 1)s is as follows:
$$ D_{N} (B,p) = \sup_{B} \left. {\left| {\frac{{\sum\limits_{n = 1}^{N} {C_{B} (X_{n} )} }}{N}} \right. - \lambda_{s} (B)} \right| $$
(7)
where D
N
(B, p) is always between [0, 1], and C
B
isan attribute function of B. Thus, \( \sum\nolimits_{n = 1}^{N} {C_{B} (X_{n} )} \) shows the number of points 1 ≤ n ≤ N and x
n
\( \varepsilon \) B.
Definition 7.4
(Star discrepancy) Assume J
* is the family of all sub-intervals [∘, 1)sas \( \prod_{i = 1}^{s} [ \circ , u_{i} )^{s} , \circ < u_{i} \le 1 \). The star discrepancy of the set of p = {X
1,…, X
N
} on substituting with J* in place of B in Eq. [6] is as follows:
$$ D_{N}^{*} = D_{N} (J^{*} ,P) = \sup_{{B{_\varepsilon} J^{*} }} \left| {\frac{{\sum\limits_{n = 1}^{N} {C_{B} (X_{n} )} }}{N} - \lambda (B)} \right|. $$
(8)
Theorem 7.1
(Koksma Inequality) If f has bounded changes v(f) in [0, 1], then for each set of p = {X
1
, …, X
N
} of [0, 1], we have
$$ \left| {\frac{{\sum\nolimits_{n = 1}^{N} {f(X_{n} )} }}{N} - \int_{ \circ }^{1} {f(x)dx} } \right| \le v(f)D_{N}^{*} (p) $$
This inequality states that sequences with low discrepancy lead to low error [9].
In Monte Carlo method, there was an aggregation of points as the points were independent, and they had no awareness of each other, and there was little chance that they were very close to each other. Quasi-random sequences had better uniformity and rapid convergence compared with pseudo-random sequence. Some of the quasi-random sequences are mentioned later, and they are calculated by means of MATLAB software.
Van der corput sequence
This is the first sequence by which low discrepancy was formed.
To obtain the nth point of this sequence, at first, n on base b is defined as \( n = \sum_{j = \circ }^{m} a_{j} \left( n \right)b^{j} \) where coefficients a
j
(n) include {∘, 1,…, b − 1}values. We use these coefficients to achieve quasi-random values as \( X_{n} = \phi_{b} (n) = \sum\nolimits_{j = \circ }^{m} {a_{j} (n)\frac{1}{{b^{j + 1} }}} \). Some of a
j
(n) values are nonzero. M is the smallest integer for each j > m as a
j
(n) = 0 (Table 1).
Table 1 Calculation of ten first points of Van der corput sequence in basis 3
Van der corput sequence is a unidimensional sequence and generates random data of this sequence; in high dimensions, they can lose their random state and follow a linear function.
Halton sequence
Halton sequence was proposed in 1960, and it is similar to Van der corput sequence. First dimension of Halton sequence is a Van der corput sequence in basis 2, and second dimension is a Van der corput sequence in basis 3. Indeed, we can say Halton sequence is the same as Van der corput sequence with basis value as the nth primary value for the nth dimension of Halton sequence. Halton sequence is a s-dimensional sequence in cubic [0, 1]s. Nth element of Halton sequence in [0, 1]s is defined as (Table 2)
$$ x_{n} = \left( {\phi_{{b_{1} }} (n),\phi_{{b_{2} }} (n), \ldots ,\phi_{{b_{s} }} (n)} \right)\quad \quad \quad n = \circ ,1,2, \ldots $$
(9)
Table 2 Calculation if first five points of Halton sequence for first four dimensions
Figure 3 shows 100 Halton sequences in bases 2, 3 and dimensions 1, 2 (right figure); and bases 43, 47 and dimensions 14, 15 (left figure). As shown, in low dimension, Halton sequence has suitable dispersion, but by increasing the dimension, convergence is revealed as in high dimensions, its random trend is lost and hypercube is not covered uniformly.
Sobol sequence
Sobol sequence was proposed in 1967. Constant value of basis 2 is used in Sobol sequence for all dimensions. Thus, Sobol sequence is rapid and simpler. This feature generates random numbers with low convergence in high dimensions.
To make this sequence, at first, we write n for basis 2 according to \( n = \sum_{i = \circ }^{M} a_{i} 2^{i} \) as M is the smallest value bigger or equal to \( \log_{2}^{n} \) and a
i
s values are zero or one, respectively.
The primary polynomial rank q is assumed as p = x
q + c
1
x
q−1 + ··· + c
q−1
x + 1 in which c
i
s values are zero and one. m
i
by coefficients c
i
are generated as follows:
$$ m_{i} = 2c_{1} m_{i - 1} \oplus 2^{2} c_{2} m_{i - 2} \oplus \cdots \oplus 2^{q - 1} c_{q - 1} m_{i - q + 1} \oplus 2^{q} m_{i - q} \oplus m_{i - q} $$
(10)
As ⊕ is an operator in computer represented as \( 1 \oplus \circ = \circ \oplus 1 = 1\; \; \; 1 \oplus 1 = \circ \oplus \circ = \circ \)
m
i
values are odd integer values in interval [1, 2i − 1]. V(i)s are generated according to \( V\left( i \right) = \frac{{m_{i} }}{{2^{i} }}. \)
Thus, nth element of Sobol sequence is generated according to ϕ(n) = a·v(1) ⊕ a
1
v(2) ⊕ ··· ⊕ a
i−1
v(i).
To facilitate Sobol sequence generation, Grey code coding is used, and its algorithm is given by \( \phi (n) = n \oplus \frac{n}{2}, \) and now the adjusted model is given by \( \phi (n) = n \oplus \frac{n}{2} \) (Table 3).
Table 3 Calculation of first 5 points of Sobol sequence for first 5 dimensions
Figure 4 shows 100 points of Sobol sequences in dimensions 1, 2 (right figure) and dimensions 14, 15 (left figure). As shown, in high dimensions, this sequence has good uniformity and it makes its advantage compared to other sequences.