Stochastic Computation in Finance Chuan-Hsiang Han Dept. of Quantitative Finance, NTHU Dept of Math & CS Education TMUE November 3, 2008
Outline History of Math and Finance: Fundamental Problems in Modern Finance Introduction to Monte Carlo Simulations, Importance Sampling and Variance Analysis Application 1: Risk Management Application 2: Credit Derivative Evaluation 1
The father of mathematical finance Louis Bachelier (1870-1946) PhD Thesis: Theory of Speculation. March 29, 1900. 2
The Study of Brownian Motion 1827 R. Brown 1900 L. Bachelier 1905 A. Einstein 1924 N. Wiener 1931 A. Kolmogoroff P. Levy. K. Ito full development of diffusion processes 3
Applications of BM in Finance 1900 L. Bachelier 1959 M. Osborne P. Samuelson F. Black, M. Scholes. 4
Black-Scholes Model Under the physical probability space (Ω, F, F t, IP ), there are two assets within an economy: ds t = µs t dt + σs t dw t, (stock) dr t = rdt. (bond) µ: rate of returns. r: risk-free interest rate. σ: volatility (constant). W t : 1-d. standard Brownian Motion. 5
Black-Scholes Theory (1) The Option Pricing Problem: P (t, S t ) = IE { e r(t t) H(S T ) F t } defined under the equivalent pricing probability space (Ω, F, F t, IP ), under which the stock follows ds t = rs t dt + σs t dw t. (2) The Hedging Problem: (a martingale representation for perfect replication) P (0, S 0 ) = e rt H(S T ) T 0 P x (s, S s) de rs S s. }{{} Delta 6
Black-Scholes Formula Typical payoff functions are nonlinear like H(x) = max{x K, 0} = (x K) + a call. H(x) = max{k x, 0} = (K x) + a put. K is the strike price. The celebrated BS formula for the European call option price is P (t, S t = x) = xn (d 1 ) Ke r(t t) N (d 2 ), where d 1 = ln(x/k)+(r+1 2 σ2 )(T t) d 1 σ T t. σ T t and d 2 = 7
Black-Scholes PDE By Feynman-Kac formula, the fair European option price P (t, S t = x) solves a backward linear parabolic-type PDE P t + 1 2 σ2 x 2 2 P x 2 + rx P x rp = 0, P (T, x) = H(x), where x (0, ) and t [0, T ]. 8
A Fundamental Problem in Computational Finance Given a probability space and a integrable random variable X, P = E{X}? In most cases, X = H(Y ), where Y : the risky asset price. (stochastic process) H: the payoff function. (nonlinear, irregular) Financial interpretation of P : securities price, hedging coefficient, default probability, etc. 9
Basic Monte Carlo Method (I) E{X} S N := 1 N N i=1 X i, where {X i } N i=1 are IID replications of X. Note: 1. S N is an unbiased estimator. E{S N } = E{X}. 2. variance of S N reduces linearly in N. V ar(s N ) = E { (S N E{X}) 2} = σ 2 X /N standard error := σ X. N 10
Basic Monte Carlo method (II) By LLNs, S N E{X} with Prob. 1. By an application of CLT, the 95% confidence interval of E{X} is [S N 1.65 σ X, S N N + 1.65 σ X ] N 11
Default (Ruin) Probability Estimation D.P. = P {Y > c}, Y N (0, 1) = E { I (Y >c) } 1 N N I (Yi >c) i=1 Matlab Code: Monte Carlo Simulations N=10000; % Sample Size Y=randn(1,N); % Draw N Loss Variates c=2; % default level Y1=Y>c; Default or No Default Default Prob=mean(Y1) % Sample Mean var MC=var(Y1) % Variance std MC=sqrt(var MC/N) % Standard Error 12
Numerical Example Let c = 2.5. N P S N Standard Error 1000 0.0040 0.0020 4000 0.0057 0.0012 16000 0.0062 0.0006 64000 0.0063 0.0003 Q: Can the sample size N be as large as you want in order to increase the accuracy? 13
Remarks on Monte Carlo Methods Exact simulation of X = H(Y ) can be difficult. Y is often driven by non-solvable S.D.E. H may be path-dependent. Sample size N must be finite. Algorithms generate finite Pseudo Random Numbers. Improving accuracy of S N becomes important. (Second order effect.) 14
Variance Reduction Methods Importance Sampling Variates Method: Antithetic Variates, Control Variates,... 15
Principle of Importance Sampling Change of Probability Measure E { I {Y >c} } (giveny N (0, 1)) = 1 2π = 1 2π = 1 2π I {y>c} e y2 /2 dy I {y>c} I {y>c} e y2 /2 e (y µ)2 /2 e (y µ)2 /2 dy } e µ2 /2 {{ e µy } e (y µ)2 /2 dy Likelihood Ratio = E µ { I {Z>c} e µ2 /2 e µz }, where Z N (µ, 1). 16
Importance Sampling Matlab Code Z=Y+c; mu=c; Z1=(Z>c).*exp(mu 2 0.5 mu. Z); % IS Estimator Default Prab IS=mean(Z1) var IS=var(Z1) std IS=sqrt(var IS/N) 17
Recall Default Probability Let c = 2.5 and µ = 2.5. N P S N Standard Error 1000 0.0040 0.0020 1000 (IS) 0.0057 0.00032 4000 0.0057 0.0012 4000 (IS) 0.0064 0.00016 16000 0.0062 0.0006 16000 (IS) 0.0063 0.00008 64000 0.0063 0.0003 64000 (IS) 0.0061 0.00004 Remark: One can actually compute the optimal µ by solving a minimizing variance problem. 18
c=3; µ = 3.155 Varince Reduction 19
Optimality of Change of Measures DP= E{I {Y >c} } = E µ { I{Z>c} L(Z; µ) } Lemma The variance of the estimator I {Z>c} L(Z; µ) is optimally minimized at µ = c when c is sufficiently large. Proof: 1. direct calculation. 2. by means of Large Deviations Theory. 20
High-Dimensional Extension When X is a multivariate normal, the same way of measure change can be proved as optimal! DP= E{I {Y >c} } = E µ { I{Z>c} L(Z; µ) } Theorem The variance of the estimator I {Z>c} L(Z; µ) is optimally minimized at µ = c when each component in the vector c is sufficiently large. Proof: By means of Large Deviations Theory. In fact by Cramer s Theorem. This fact is also true in dynamic models. 21
Risk Management: An Inverse Problem D.P. P {Y > c} versus the Value at Risk P {Y > V ar α } = α, where α is given. In finance, V ar α represent the loss level that will not be exceeded with (1 α)% confidence. In math, V ar α is nothing but the solution of an inverse problem. 22
Expected Shortfall In fact, VaR does not satisfy the sub-additivity property or risk diversification property in general. One can consider the Coherent risk measure (or expected shortfall, conditional VaR). That is When Y exp( c 2 /2). 2πN ( c) E {Y Y > V ar α }. is standard normal, it is equal to 23
Results of Expected Shortfall E {Y Y > c}. Again use change of measure! c BMC Exact Sol. IS 1 1.527 1.525 1.525 (0.0011) (0.0005) 2 2.372 2.373 2.378 (0.0022) (0.0023) 3 3.285 3.283 3.286 (0.0071) (0.0047) 4 4.222 4.226 4.229 (0.0328) (0.0076) 5 NaN 5.187 5.178 NaN (0.0109) 24
Link to Current Financial Crisis The event loss greater than some level (Y > c) can model a firm s default before a time (τ < T ), where τ denotes the default time and T is the maturity of a type of contracts called credit derivatives. A Central Problem: How to estimate the joint default probability E {Π n i=1 I(Y i > c i )} = E {Π n i=1 I(τ i < T )}? 25
Don t Blame the Quants There are very good reasons for the existence of derivative securities and even mortgagebacked securities. Before the collapse, Carnegie Mellon s alumni in the industry were telling me that the level of complexity in the mortgage-backed securities market had exceeded the limitations of their models. A commentary published by Forbes on Oct. 8, 2008 by Steven Shreve, the Orion Hoch professor of mathematical sciences at Carnegie Mellon University and one of the founders of Carnegie Mellon s bachelor s, master s and Ph.D. programs in quantitative finance. 26
Don t Blame the Quants (Cont.) But in most banks, the quants are not the decision-makers. When they issue warnings that stand in the way of profits, they are quickly brushed aside. 27
Introduction of Credit Derivatives A contract between two parties whose values are contingent on the creditworthiness of underlying asset (s). Single-name: only one reference asset, like CDS (Credit Default Swaps). Multi-name: several assets in one basket, like CDO (Collateralized Debt Obligations) or BDS (Basket Default Swaps). 28
Interest Rate and Currency IR/Currency Outstandings (USD) 500,000B 400,000B 300,000B 200,000B 100,000B 0B 1987 1989 1991 1993 1995 1997 1999 2001 2003 2005 2007 ISDA Market Survey 29
Credit Default Swap Credit Default Swap Outstandings (USD) 65,000B 52,000B 39,000B 26,000B 13,000B 0B 2001 2002 2003 2004 2005 2006 2007 20081H ISDA Market Survey 30
Source: Securities Industry and Financial Markets Association. 31
A Example: CDS Evaluation premium = IE {(1 R) B(0, τ) I(τ < T )} / IE N j=1 τ t j 1 j 1, j B(0, τ) I(t j 1 < τ t j ) t j t j 1 Notations: τ: default time, R: recovery rate, B(0, t): discount factor, j 1, j : time increment. 32
Characterization of Default Events Gaussian Copula Factor Model (Laurent and Gregory (2003)) = = = {τ i = Fi 1 (Φ(W i )) T } { W i = ρ i Z 0 + Z 0 Φ 1 (F i (T )) 1 ρ 2 i Z i Φ 1 (F i (T )) ρ i Z i Φ 1 (F i (T )) ρ i z 0 1 ρ 2 i } 1 ρ 2 i z i whenz i = z i whenz 0 = z 0. 33
Conditional Importance Sampling Joint D.P. IE { ni=1 1 (τi T )} = (1) Conditional on common factor IE ĨE (u 1,,u n ) Π n i=1 1 (Z i c i ρ i Z 0) Πn i=1 L(Z i; u i ) Z 0 1 ρ 2 i (2) Conditional on marginal factors IE ĨE Π n i=1 1 Z0 c i 1 ρ 2 i Z i ρ i L(Z o ; u) Z 1,, Z n 34
Estimating Default Leg of BDS: I 95% confidence intervals of basic Monte Carlo and importance sampling conditional on marginal factors, given increasing reciprocal of intensities. (τ is an order statistic.) 35
Estimating Default Leg of BDS: II 95% confidence intervals of basic Monte Carlo and importance sampling conditional on the common factor, given increasing reciprocal of intensities. (τ is an order statistic.) 36
Another Credit Risk Modeling: Structural Form Approach Multi-Names Dynamics: for 1 i n ds it = µ i S it dt + σ i S it dw it, d W it, W jt = ρij dt. Each default time τ i for the i th name is defined as τ i = inf{t 0 : S it B i }, where B i denotes the i th debt level. The i th default event is defined as {τ i T }. 37
Structural Form Approach: Review Merton (1974) applied Black-Scholes Option Theory (1973). Default time only happens at maturity. Black and Cox (1976) proposed the first passage time problem (1-dim) to model default event. Zhou (2001) extended to 2-dim case. Vestal, Carmona, Fouque (2008) Interacting Particle Systems: multi-names. 38
Joint Default Probability: First Passage Time Problem Q: How to compute DP = IE { Π n i=1 I (τ i T )}? Explicit Formulas exist for 1 and 2 names cases so far...(no mention for stochastic correlation/volaility...) 39
Multi-Dimensional Girsanov Theorem Given a Radon-Nikodym derivative, dip dĩp = Q T = exp ( T 0 h(s, S s) d W s 1 2 T such that W t = W t + t 0 h(s, S s )ds is a vector of Brownian motions under ĨP. 0 h(s, S s) 2 ds ) 40
Monte Carlo Simulations: Importance Sampling An importance sampling method is to select a constant vector h = (h 1,, h n ) to satisfy the following n conditions ĨE {S it F 0 } = B i, i = 1,, n. Each h i can be uniquely determined by the linear system Σ i j=1 ρ ijh j = µ i σ ln B i/s i0 i σ i T so that DP = ĨE { Π n i=1 I (τ i T ) Q T }. 41
Trajectories under different measures Single Name Case 42
Single Name Default Probability B BMC Exact Sol Importance Sampling 50 0.0886 (0.0028) 0.0945 0.0890 (0.0016) 20 0 (0) 7.7 10 5 7.2 10 5 (2.3 10 6 ) 1 0 (0) 1.3 10 30 1.8 10 30 (3.4 10 31 ) Number of simulations are 10 4 and the Euler discretization takes time step size T/400, where T is one year. Other parameters are S 0 = 100, µ = 0.05 and σ = 0.4. Standard errors are shown in parenthesis. 43
The Optimal Variance Reduction: A Numerical Evidence 10 50!(") vs P B (T), B = 15 10 40!(") P B (T) 10 30 10 20 10 10 10 0 10!10 10!20 10!30 0 10 20 30 40 50 60 70 80 90 " 44
Three-Names Joint Default Probability ρ BMC Importance Sampling 0.3 0.0049(6.98 10 4 ) 0.0057(1.95 10 4 ) 0 3.00 10 4 (1.73 10 4 ) 6.40 10 4 (6.99 10 5 ) -0.3 0(0) 2.25 10 5 (1.13 10 5 ) Parameters are S 10 = S 20 = S 30 = 100, µ 1 = µ 2 = µ 3 = 0.05, σ 1 = σ 2 = 0.4, σ 3 = 0.3 and B 1 = B 2 = 50, B 3 = 60. Effect of Correlations! Debt to Asset-Value Ratios (B i /S i0 ) are not small. 45
In fact, the choice of our new measure is optimal in Large Deviations Theory regardless of the dimensions and moments. So our importance sampling is efficient! 46
Some Mathematical Issues Remain Modeling default time Modeling correlations between default times Incorporate more realistic situations 47
Conclusion Introduction of mathematical theory in financial applications. Introduction of a stochastic computation: Monte Carlo simulations and importance sampling. Financial applications in option pricing, default probability, risk management, and credit derivatives. 48
We enter an era of high-dimensional and structured finance. Welcome!
Thank You for Your Patience! 49