Solutions to Exercise Handout 4. Prof. Dr. Christian Fries, Juan Miguel Montes.
Wintersemester 2013/2014. Exercise Solution 12. The example Java program ...
Numerical Methods in Financial Mathematics. Prof. Dr. Christian Fries, Juan Miguel Montes
Solutions to Exercise Handout 4 Wintersemester 2013/2014
Exercise Solution 12 The example Java program with the solution to Exercise 12 is found in Exercise12Test.java under net.exercise4.montecarlo.variance in the quantlab finmath exercises repository. For a seed of 1234, µ = 0.0, the graphs produced are as follows:
Figure 1: Empirical mean of samples, as theoretical variance is reduced.
Figure 2: Empirical variance of samples, as theoretical variance is reduced.
b Figure 3: Monte-Carlo Error (i.e., |E[X] − µ|) as theoretical variance is reduced.
1
Figure 4: Variance Rate (i.e., Vd ar[X]/N ) as theoretical variance is reduced. Figure 1 shows that for a fixed value of theoretical variance, the empirical mean approaches the theoretical mean, as the number of samples are increased. It also shows that, for a fixed value of the number of samples, the empirical mean approaches the theoretical mean as the theoretical variance is decreased. Figure 2 shows that for a fixed value of theoretical variance, the empirical variance increases and approaches the theoretical variance, as the number of samples are increased. It also shows that, for a fixed value of the number of samples, the empirical variance decreases as the theoretical variance is decreased. Figure 3 shows that for a fixed value of theoretical variance, the Monte-Carlo error approaches zero, as the number of samples are increased. It also shows that, for a fixed value of the number of samples, the Monte-Carlo error approaches zero as the theoretical variance is decreased. Figure 4 shows that for a fixed value of theoretical variance, the Variance Rate approaches zero as the number of samples are increased. It also shows that, for a fixed value of the number of samples, the Variance Rate approaches zero as the theoretical variance is decreased. It can be seen that the Monte-Carlo error and the Variance Rate behave in the same way, with respect to theoretical variance and number of samples. In fact, this reflects the property that the Monte Carlo b error En [X] − µ for n samples is related to the theoretical variance as follows √ bn [X] − µ ⇒ N (0, σ 2 ) n E where σ 2 is the theoretical variance. The convergence ⇒ here denotes convergence in distribution, i.e. ! bn [X] − µ E lim P ≤ x = Φ(x), σ n→∞
√
n
where Φ(x) is the standard normal c.d.f. (See Chapter 1, Section 1.1.3 in Glasserman, Monte-Carlo Methods in Financial Engineering. Springer. 2004 ). If you have further questions or need clarifications, please write an e-mail to the address:
[email protected]
2