400 likes | 471 Views
Financial Engineering. Zvi Wiener mswiener@mscc.huji.ac.il 02-588-3049. Monte Carlo Simulations. Plan. 1. Monte Carlo Method 2. Variance Reduction Methods 3. Quasi Monte Carlo 4. Permuting QMC sequences 5. Dimension reduction 6. Financial Applications simple and exotic options
E N D
Financial Engineering Zvi Wiener mswiener@mscc.huji.ac.il 02-588-3049 http://pluto.mscc.huji.ac.il/~mswiener/zvi.html
Monte Carlo Simulations http://pluto.mscc.huji.ac.il/~mswiener/zvi.html
Plan • 1. Monte Carlo Method • 2. Variance Reduction Methods • 3. Quasi Monte Carlo • 4. Permuting QMC sequences • 5. Dimension reduction • 6. Financial Applications • simple and exotic options • American type • prepayments FE-Monte Carlo
Monte Carlo FE-Monte Carlo
Monte Carlo FE-Monte Carlo
Monte Carlo FE-Monte Carlo
Monte Carlo FE-Monte Carlo
Generating Normal Variables • Very simple method of generating almost Normal random variables: pi are uniformly distributed between 0 and 1. FE-Monte Carlo
Multi dimensional random numbers • Goal : to generate an n-dimensional vector each component of which is a normally distributed random number, with correlation matrix S. • Cholesky factorization: S=MMT, where M is lower triangular, see example. FE-Monte Carlo
Cholesky factorization • Needs["LinearAlgebra`Cholesky`"] • s = Table[1/(i + j - 1), {i, 1, 4}, {j, 1, 4}]; • Eigenvalues[N[s]]; • u = CholeskyDecomposition[s]; • u // MatrixForm • MatrixForm[Transpose[u].u] FE-Monte Carlo
Monte Carlo in Risk Management • Distribution of market factors • Simulation of a large number of events • P&L for each scenario • Order the results • VaR = lowest quantile FE-Monte Carlo
How to design MC • The central point is to model the distribution of relevant risk factors. • For example, in pricing you should use the risk-neutral distribution. • For risk measurement use true distribution. • What should be used for an estimate of frequency of hedge? FE-Monte Carlo
Geometrical Brownian Motion FE-Monte Carlo
Lognormal process FE-Monte Carlo
Euler Scheme FE-Monte Carlo
Milstein Scheme FE-Monte Carlo
MC for simple options • Needs["Statistics`NormalDistribution`"] • Clear[MCEuropean, MCEuropeanCall, MCEuropeanPut] • nor[mu_,sig_]:=Random[NormalDistribution[mu,sig]]; FE-Monte Carlo
MC for simple options • MCEuropean[s_, T_, r_, _, n_, exercise_Function]:= • Module[{m = N[Log[s]+(r - 0.52)*T], sg=N[ Sqrt[T] ], tbl}, • tbl= Table[nor[m, sg], {i, n}]; • Exp[-r*T]*Map[exercise, Exp[Join[tbl, 2*m - tbl]]]// • {Mean[#], StandardErrorOfSampleMean[#]}& • ] FE-Monte Carlo
MC for simple options • MCEuropeanCall[s_, x_, T_, r_, _, n_]:= • MCEuropean[s, T, r, , n, Max[#-x,0]&] • MCEuropeanPut[s_, x_, T_, r_, _, n_]:= • MCEuropean[s, T, r, , n, Max[x-#,0]&] FE-Monte Carlo
MC for path dependent options • RandomWalk[n_Integer] := • FoldList[Plus, 0, Table[Random[] - 1/2, {n}]]; • ListPlot[ RandomWalk[500], PlotJoined -> True]; FE-Monte Carlo
MC for path dependent options • The function paths generates a random sample of price paths for the averaging period. It returns a list of numberPathsrandom paths, each consisting of numberPrices prices over the period from time T1 to time T. The prices at the start of the period are given by the appropriate lognormal distribution for time T1. FE-Monte Carlo
MC for path dependent options • paths[s_,sigma_,T1_,T_,r_,numberPrices_,numberPaths_]:= • Module[{meanAtT1=Log[s]+(r-sigma^2/2)*T1, • sigmaAtT1 = sigma*Sqrt[T1], • meanPath = 1+ r*(T-T1)/(numberPrices-1), • sigmaPath = sigma*Sqrt[(T-T1)/(numberPrices-1)] • }, • Table[NestList[# nor[meanPath,sigmaPath]&, • Exp[nor[meanAtT1,sigmaAtT1]], • numberPrices - 1], {i,numberPaths}] • ] FE-Monte Carlo
MC for Asian options • MCAsianCall[s_,x_,sigma_,T1_,T_,r_,numberPrices_,numberPaths_]:= • Module[{ t1, t2, t3}, • t1 = paths[s,sigma,T1,T,r,numberPrices,numberPaths] ; • t2 = Map[Max[0,Mean[#] - x]&, t1]; • t3 = Exp[-T*r]*t2; • {Mean[t3], StandardErrorOfSampleMean[t3]} • ] FE-Monte Carlo
Speed of convergence Whole circle Upper triangle FE-Monte Carlo
Smart Sampling FE-Monte Carlo
Spectral Truncation FE-Monte Carlo
Variance Reduction • Let X() be an option. • Let Y be a similar option which is correlated with X but for which we have an analytic formula. • Introduce a new random variable FE-Monte Carlo
Variance Reduction • The variance of the new variable is If 2cov[X,Y] > 2var[Y] we have reduced the variance. FE-Monte Carlo
Variance Reduction • The optimal value of is Then the variance of the estimator becomes: FE-Monte Carlo
Variance Reduction • Note that we do not have to use the optimal * in order to get a significant variance reduction. FE-Monte Carlo
Multidimensional Variance Reduction • A simple generalization of the method can be used when there are several correlated variables with known expected values. • Let Y1, …, Yn be variables with known means. • Denote by Y the covariance matrix of variables Y and by XY the n-dimensional vector of covariances between X and Yi. FE-Monte Carlo
Multidimensional Variance Reduction • Then the optimal projection on the Y plane is given by vector: The resulting minimum variance is where FE-Monte Carlo
Variance Reduction • Antithetic sampling • Moment matching/calibration • Control variate • Importance sampling • Stratification FE-Monte Carlo
Quasi Monte Carlo • Van der Corput • Halton • Haber • Sobol • Faure • Niederreiter • Permutations • Nets FE-Monte Carlo
Quasi Monte Carlo • Are efficient in low (1-2) dimensions. • Sobol sequences can be used for small dimensions as well. • As an alternative one can create a fixed set of well-distributed paths. FE-Monte Carlo
Do not use free sequences FE-Monte Carlo
Other MC applications • Pricing • Optimal hedging • Impact of dividends • Bounds on a basket • Prepayments • Tranches of MBS FE-Monte Carlo
Other MC related topics • Use of analytical approximations • Richardson extrapolation • Ratchets example • American properties • Bundling • Modeling Fat tails FE-Monte Carlo
Home Assignment • Read chapter 26 in Wilmott. • Read and understand the Excel file coming with this chapter. • Calculate using the method described in class. • Calculate a value of a simple Call option using Monte Carlo method (design your spreadsheet). FE-Monte Carlo