Comment on Monte Carlo Method

There is a general notice before the start of this comment: In numerical simulation, monte carlo method is useful for larger dimension, whereas finite difference method is more useful tan Monte Carlo Method in smaller dimension.

Lecture 1

  1. The generation of the random number includes three steps: Generating independent uniform on [0,1]; generating independent standard normal; generating correlated normal.
  2. The useful RNG is Mersenne Twister, which is 219937-1.
  3. Four popular method for random normal generators:
  4. Box-Muller: advantage: easy to understand; Disadvantage: log, cos and sin are quite expensive to calculate.
  5. Marsaglia Polar Method: Advantage: Not that expensive compared with Box Muller method. Disadvantage: Need to abandon some of the random numbers, so it is not that useful when parallel is used.
  6. Marsaglia zigguart method: Advantage: fastest. Disadvantage: hardest to understand.
  7. Inverse Normal Method: Advantage: As accurate as other method,, but still costly.
  8. The normal cdf is related to the error function erf(x): Φ (x) = 1/2+1/2 erf (x/ sqrt(2)).
  9. Two ways calculate the correlated random normal numbers:
  10. Cholesky factorization and PCA decomposition to find out the method for the doing

Lecture 2

  1. Integrating a function on the range of [0,1] is just like calculating the expectation of the function under uniform distribution. Hence the integration can be estimated through calculating the average of the function evaluated at random [0,1] uniform numbers.
  2. The estimator above is unbiased and consistent.
  3. The error is to subtract estimated value from the real value. Bias is the expectation of the error. Root Mean Square Error is square root of the expectation of error square.
  4. The empirical variance can be calculated via general procedure: sum of square minus square of sum. To get the unbiased estimator, one can times the empirical variance with the fraction (N-1)/N.
  5. To calculate the number of samples needed for the required accuracy: N = (σ s(c))/ε)^2.
  6. The root means square error can be regarded as the variance of the error.
  7. When d>4 Monte Carlo Method is much more useful than finite difference method.
  8. Similar way of simulating expectation with independent and correlated density random normal. Simply invert the normal distribution and take expectation on the invnorm and original function with regard to uniform distribution. It’s similar for the correlated random normal as only need times the independent random normal with the decomposed variance covariance matrix based on Cholesky or PCA Method.
  9. The decrease of the accuracy always implies the increase of the computing time. Hence there is a trade-off between the accuracy and efficiency.

Lecture 3

  1. Variance reduction is very important in Monte Carlo Method as one may apply simple method to reduce the variance in certain circumstance.
  2. There are six ways in variance reduction.
  3. Antithetic Method: Notice that this method can only be applied for the situation when the distribution function is and even function. Advantage : The variance is always reduced. Disadvantage: Disadvantage: The computational cost doubles. Hence net benefit only if the co-variance of f(w) and f(-w) is smaller than  0.
  4. Best case: linear payoff. Worst case: symmetric payoff.
  5. Control variate. If there is another payoff f for which we know the expectation, can use g-E(g) to reduce the error in f-E(f).
  6. The good situation is f and g are near linear correlated. Worst situation is that f and g are independent.
  7. Importance Sampling: The basic idea is change of probability measure.
  8. For the last sentence in the page 20 of this lecture, the choosing of μ2 which gives the distribution of the new sampling.
  9. For the normal distribution, change of mu can be useful when one part of the tail is important,while change of σ is useful when both tails are important.

 Lecture 4

  1. Stratified Sampling: The key idea is to achieve a more regular sampling of the most important dimension in the uncertainty.
  2. Procedure: divide the [0,1] interval into M strata ——> take L samples from each strata. ML = N i.e.total sample sizes.
  3. The procedure for this simulation: Break [0,1] in to M strata ——> Take L samples U with uniform probability distribution ——> Define independent random vector from invnorm and uniform samples——> compute average for each strata and overall average.
  4. There is a trade-off between efficiency and confidence.
  5. Notice that it is better to sample more from the strata with her variability.
  6. The multivariate application is similar.
  7.  For higher dimension, the number of cube to choose sample from can be quite large. This may forces the sample chosen from each cube can be quite small. Hence the  new method called Latin Hypercube is introduced.
  8.  Latin Hypercube: Generate M points dimension by dimension ,using sampling with 1 value per stratum, assigning them randomly to the M points to give precisely one point in each stratum. ——> Take L such independently generated set of points, each giving the same average.
  9. In the special case that the function can be written in the sum of one dimension function, then there will be a very large sample size reduction by using large sample size M.

Lecture 5

  1. Quasi Monte Carlo. Standard quasi monte carlo uses the same equal weight estimator but chooses the points systematically so that the estimate is biased, error roughly proportional to 1/N and there is no confidence interval.
  2. To construct the set of points we want to use for the quasi Monte Carlo method, there is one thing called Rank-1 Lattice Rule. (see notes page 9).z is the generating vector with integer components co-prime with N.
  3. Sobol sequence: The idea of the Sobol sequence is to subdivide each dimension with into halves ,quarters etc, and in each cube the number of the sample points are the same.
  4. randomized QMC: Using randomized QMC.
  5. QMC points have the porperty that the points are more uniformly distributed through the lowest dimension. Sonsequently, itis important to think about how the dimensions are allocated to the problem. Previously, have generated correlated Normals through the decomposition of the variance co-variance matrix.

Lecture 6

  1. Finite precision arithmetic: a floating point can be represented f = x × 2n  where n is the integer expoennt which is given by some number of bits. 1/2<|x|<1 also represented by some number of digits.
  2. relative error is about 10-16 for long and 10-7 for short.
  3. For the sum, the standard error for the sum is given by the 2-S sqrt(N). where N is the size of the sum.
  4. The error can be fatal when we want to simulate the differetiation.
  5. Complex trick: involving complex number may also gives the same result but less error. We only need to take the imaginary part of the function evaluate at point (x+ i dx)). Hence one can take dx small enough. The only issue is that the function should be analytic.

Lecture 7

  1. Greeks is a set of functions that measure the change of value of one derivative corresponding to change of one parameter.
  2. The error might be quite large if take random uniform vector for each X(θ + Δ θ) and X(θ – Δ θ).
  3. In order to solve this, we use same random input for both X(θ + Δ θ) and X(θ – Δ θ).
  4. Finite Difference Sensitivity  : There might be some issues when the payoff function is not continuous, hence we need to be very careful about the payoff jump at the non continuity point of the function.
  5. The probability for the payoff jumps at the interval [θ – Δ θ,θ + Δ θ] is O(Δ θ). With this, the variacne might get really large when the Δ θ is small.
  6. Hence what we want to minimise is the mean square error. And the best choice for Δ θ is N -1/5.
  7. For discontinuous second derivative, it will also makes the variance quite large.

Lecture 8

  1. Likelihood ratio method and path-wise sensitivity: In previous method we consider derivative of the density function with respect to the &theta; while the path-wise sensitivity take the derivative of the function that we want to take the expectation with.
  2. In the likelihood ratio method, we do not change the measure. We change the function we want to to take expectation with.
  3. For this method , the variance is very large when &sigma; is  small, and it is also large for &Delta; when T is small. (We are talking about estimating the price ).
  4. For path-wise sensitivity, we consider differentiate the function instead. But in this case, we need to assume that the function is differentiable. Similar thing can be applied to second order differentiation.
  5. For the discontinuous situation, we can use smooth function to approach non continuous function, and take the limit as the final result. E.g one example for smoothing is to use the cumulative normal to smooth the digital call function.
  6. The idea of these two methods are still based on simulating, hence we can calculate the expectation via the simulation method with respect to the function inside the bracket after the transformation.