Theorem 4.1 Theorem 4.1 The acceptance-rejection algorithm generates a random vari- able X such that
6.3 STRATIFIED SAMPLING
STRATIFIED SAMPLING 97
98 VARIANCE REDUCTlON TECHNIQUES
It can be easily seen that if U
-
U ( 0 , l), then V = a+
( b - a)U is distributed as uniform ( a , b). In particular, U / 2 N U(0,1/2) and (U+
1 ) / 2 N U(1/2,1).To compute the variance of the new estimator, consider
2n
i=l i=n+l
Direct computations show that if Ui
-
U(0, l), thenU,
Var(g(-)) 2 = 2 g2(x)dx -4m:,
Consequently,
Var(6,) = -
2n Note that
(ml
+
7 7 ~ 2 ) ~+
( r n l - m2)2 = 2(m4+
m;).Therefore.
Since this second term is always non-negative, stratification reduces the vari- ance by an amount of this second term. The bigger the difference in ml and m2, the greater the reduction in variance. In general, if more strata are in- troduced, more reduction will be achieved. One can generalize this result to the multi-strata case, but we will omit the mathematical details here.
Example 6.4 Consider again 0 = E ( 8 ) =
s,’
e” dx.Recall that by standard Monte Carlo with n = 2 ,
STRATIFIED SAMPLING 99 and Var(g) = 0.121. On the other hand, using stratification, we have
and Var(g,)= Var(g) -(ml - m ~ ) ~ / 2 , where ml = s:l2 ex d x = e l l 2 - 1 and
m2 =
sl,2
1 ex d x = e - ell2. Thus,Var(gs) = 0.121 - (2e1l2 - e - 1)'/2 = 0.0325, resulting a variance reduction of 73.13%.
Stratified sampling is also very useful to draw random samples from desig- nated ranges. For example, if we want t o sample 21,
. . .
, 2 1 0 0 from a standard normal distribution, the standard technique would partition the whole real line(-CO, m) into a number of bins and sample 2s from these bins randomly. In such a case, it is inevitable that some bins may have more samples while other bins, particularly those near the tails, may have no sample at all. Therefore, a random sample drawn this way would under represent the tails. While this may not be a serious issue in general, it may have severe effect when the tail is the quantity of interest, such as the case in the simulation of VaR. To ensure that the bins are regularly represented, we may generate the 2 s as follows.
Let 1
where Ui
-
U(0,l) i.i.d. By the property of uniform distribution, V,-
U ( % , &). Now let Zi =
@-'(&).
Then 2, falls between the i - 1 and i percentiles of the standard normal distribution. For example, if i = 1, then V = U/100-
U(0,1/100) so that Z = @ - ' ( V ) falls between @ - l ( 0 ) = -a and @-'(0.01), i.e., the 0th and the 1st percentile of a standard normal distribution.This method gives equal weight to each of the 100 equiprobable strata.
Of course, the number 100 can be replaced by any number that is desirable.
The price we pay in stratification is the loss of independence of the 2s. This complicates statistical inference for simulation results.
Example 6.5 As an illustration of stratification, consider simulating stan- dard normal random numbers via standard method and stratification method, respectively. As can be clearly seen from Fig. 6.3 and Fig. 6.4, stratified sam- pling generates samples much more uniformly over the range than standard Monte Carlo. The SPLUS codes for these simulations are given as follows.
v
- -(U2+
(i - l)), i = I , . . . ,100,- 100
######## Standard method ########
N <- 500
U1 <- runif(N)
XI <- qnorm(U1)
hist (Xl,freq=F,xlim=range(-3.5,3.5) ,nclass=50)
100 VARlANCE REDUCTION TECHNIQUES
0
V I -
-
0 -
-
U)-
0
######## Stratified Sampling #I#######
U2 <- runif(N)
i <- O:(N-I)
V <- (U2+i)/N
X2 <- qnorm(V)
hist (X2,freq=F,xlim=range(-3.5,3.5) ,nclass=50)
I I11
11111 1 L,.
I II I I
-2 0 2
x1
Fig. 6.3 Simulations of 500 standard normal random numbers by standard Monte Carlo.
-2 0 2
x2
Fig. 6.4 Simulations of 500 standard normal random numbers by stratified sampling.
Example 6.6 As a second illustration of stratzfication, consider the simula- tion of a European call option of Example 5.2 again.
STRATIFIED SAMPLING 101
In Example 5.2, we simulate the terminal prices Sl(T),
. . . ,
S,(T) according to (5.9) and then compute the estimate asIn this standard simulation, the random normals are samples arbitrarily over the whole real line. We can improve the efficiency by introducing stratification.
1. Partition (-CO, CO) into B strata or bins.
2. Set V, =
A(& +
( i - l)), i = 0,.. . ,
B and generate the desired number of random samples ( N E , say) of V s in the ith bin.3. Apply W1(V,) to get the desired normal random numbers from each bin and calculate C, from each bin.
4. Average the Ci over the total number of bins to get an overall estimate
c.
5. Calculate the standard error as in the previous cases.
This numerical example uses So = 10, K = 12, T = 0.03, c = 0.40, and T = 1. The theoretical Black-Scholes price is 1.0139. We simulate the European option price for different bin sizes with NE x B = 1,000 in all cases.
The effect of stratification increases as we increase the number of bins. The I7 SPLUS code and the results (Table 6.1) are as follows.
n <- I000 # total sample size
B <- I00 #no. of bins
NB <- n/B
so
<- 10K <- 12
mu <- 0.03
sigma <- 0.4
nu <- mu-sigmaA2/2
t <- I
U <- 0
z <- 0
ST <- rep(0,NB)
Ci <- rep(0,NB)
Ci .bar <- 0 varr <- 0
for (i in 0: (B-1))
<
U <- runif(NB)
z <- qnorm((u+i)/B)
102 VARlANCE REDUCTlON TfCHNlQUfS
for (j in 1:NB)
ST[j]
c
<- SO*exp(nu*t+sigma*sqrt(t)*z[j]Ci [ j
1
<- exp (-mu*t) *max (ST j 1 -K , 0)3
Ci.bar <- Ci.bar + mean(Ci) varr <- varr + var(Ci)3
C <- Ci.bar/BSE <- sqrt (varr/NB) /B
C SE
Bins (B) NB Mean (C) Std. Err.
~~ ~
1 1000 0.9744 0.0758
2 500 1.0503 0.0736
5 200 1.0375 0.0505
10 100 0.9960 0.0389
20 50 0.9874 0.0229
50 20 1.0168 0.0146
100 10 0.9957 0.0092
200 5 1.0208 0.0094
500 2 1.0151 0.0062
1000 1 1.009s NA
Table 6.1 Effects of stratification for simulated option prices with different bin sizes.
Regular stratification puts equal weight on each of the B bins. Such an allocation may not be ideal as one would like to have sample sizes directly related to the variability of the target function over that bin. To illustrate this point, consider the payoff of a European call option again.
Example 6.7 Stratified sampling for a European call with the same parame- ter values as an Example 6.5.
We know that if ST < K , then the payoff of the call is zero. Recall
STRATIFIED SAMPLING 103
Therefore, ST
<
K iff S ~ e [ T - u Z ~ 2 ] T + f f f i Z<
K . That is,Z <
[log(K/So) - (F - a 2 / 2 ) T ] / ( a d F ) := L.Every simulated Z
<
L is being wasted as it just returns the value 0. We should only be concentrating on the interval [L, m). How can we achieve this goal?1. Find out the c.d.f. of a normal distribution Y restricted on [L, m). It can be shown that Y has c.d.f.
2. Use the inverse transform method to generate Y . Consider the inverse transformation of F , i.e., solve for y such that y = F - l ( x ) . Writing it out, we have x = F(y) =
'?';:$)
so thaty = @-1(x(l - @ ( L ) )
+
@ ( L ) ) . Now generate U from uniform (0,l) and evaluateY = @-1(U(1- @ ( L ) )
+
@ ( L ) ) .3. Plug in the generated Y into the simulation step of the payoff of the call and complete the analysis. Note that when evaluating the new estimator for the payoff, we need to multiply the factor 1 - @(L). That is,
c*
= (1 - @ ( L ) ) C ,where C is the average of the simulated payoffs using the truncated normal random variables.
In general, we would like to apply the stratification technique t o bins in which the variability of the integrand is largest. Here, we just focus the entire
cl
sample on the case ST
>
K .The SPLUS code and the output (Table 6.2) are given as follows:
n <- I000 # t o t a l sample size
B <- 100 #no. of bins
NB <- n/B
so
<- 10K <- 12
mu <- 0.03
sigma <- 0.4
nu <- mu-sigma-2/2
t <- I
104 VARIANCE REDUCTlON TECHNIQUES
U <- 0
z <- 0
ST <- rep(0,NB)
Ci <- rep(0,NB)
Ci.bar <- 0 varr <- 0
L <- {log(K/SO)-(mu-sigma-2/Z)*t~/(sigma*t)
f o r (i in O:(B-I))
U
I
<- runif(NB)v <- (u+i)/B
z <- qnorm(v*(I-pnorm(L))+pnorm(L))
f o r (j in 1:NB)
t ST[j] <- SO*exp(nu*t+sigma*sqrt(t)*z[j])
Ci [j] <- exp(-mu*t) *rnax(ST[jl -K, 0)
>
Ci.bar <- Ci.bar + mean(Ci) varr <- varr + var(Ci)
>
C <- (l-pnorm(L))*Ci.bar/B
SE <- sqrt (varr/NB) /B
C SE
## The theoretical Black-Scholes value is 1.0139