Presentation is loading. Please wait.

Presentation is loading. Please wait.

Appendix 19 A Microsoft Excel Program for Calculating Cumulative Bivariate Normal Density Function ( 19.8.2) By Cheng Few Lee Joseph Finnerty John Lee.

Similar presentations


Presentation on theme: "Appendix 19 A Microsoft Excel Program for Calculating Cumulative Bivariate Normal Density Function ( 19.8.2) By Cheng Few Lee Joseph Finnerty John Lee."— Presentation transcript:

1 Appendix 19 A Microsoft Excel Program for Calculating Cumulative Bivariate Normal Density Function ( ) By Cheng Few Lee Joseph Finnerty John Lee Alice C Lee Donald Wort

2 Option Explicit Public Function Bivarncdf(a As Double, b As Double, rho As Double) As Double Dim rho_ab As Double, rho_ba As Double Dim delta As Double If (a * b * rho) <= 0 Then If (a <= 0 And b <= 0 And rho <= 0) Then Bivarncdf = Phi(a, b, rho) End If If (a = 0 And rho > 0) Then Bivarncdf = Application.WorksheetFunction.NormSDist(a) - Phi(a, -b, -rho) End If If (a >= 0 And b 0) Then Bivarncdf = Application.WorksheetFunction.NormSDist(b) - Phi(-a, b, -rho) End If If (a >= 0 And b >= 0 And rho <= 0) Then Bivarncdf = Application.WorksheetFunction.NormSDist(a) + Application.WorksheetFunction.NormSDist(b) Phi(-a, -b, rho) End If Else rho_ab = ((rho * a - b) * IIf(a >= 0, 1, -1)) / Sqr(a ^ * rho * a * b + b ^ 2) rho_ba = ((rho * b - a) * IIf(b >= 0, 1, -1)) / Sqr(a ^ * rho * a * b + b ^ 2) delta = (1 - IIf(a >= 0, 1, -1) * IIf(b >= 0, 1, -1)) / 4 Bivarncdf = Bivarncdf(a, 0, rho_ab) + Bivarncdf(b, 0, rho_ba) - delta End If End Function 2

3 Public Function Phi(a As Double, b As Double, rho As Double) As Double Dim a1 As Double, b1 As Double Dim w(5) As Double, x(5) As Double Dim i As Integer, j As Integer Dim doublesum As Double a1 = a / Sqr(2 * (1 - rho ^ 2)) b1 = b / Sqr(2 * (1 - rho ^ 2)) w(1) = w(2) = w(3) = w(4) = w(5) = x(1) = x(2) = x(3) = x(4) = x(5) = doublesum = 0 For i = 1 To 5 For j = 1 To 5 doublesum = doublesum + w(i) * w(j) * Exp(a1 * (2 * x(i) - a1) + b1 * (2 * x(j) - b1) + 2 * rho * (x(i) - a1) * (x(j) - b1)) Next j Next i Phi = * Sqr(1 - rho ^ 2) * doublesum End Function 3

4 Appendix 19 B Microsoft Excel Program for Calculating American Call Options ( ) By Cheng Few Lee Joseph Finnerty John Lee Alice C Lee Donald Wort

5 Number * ABC* 1 Option Pricing Calculation 2 3S (current stock price)=50 4 S t * (critical exdividend stock price)= S(current stock price NPV of promised dividend)= =B3-B11*EXP(-B7*B10) 6 X (exercise price of option)= 48 7r(risk-free interest rate)=0.08 8σ(volatility of stock)=0.2 9T(expiration date)= t(exercise date)= D(Dividend)=2 12d 1 (nondividend-paying)= =(LN(B3/B6)+(B7+0.5*B8^2)*B9)/(B8*SQRT(B9)) 13d 2 (nondividend-paying)= =B12-B8*SQRT(B9) 14 d 1 *(critical exdividend stock price)= =(LN(B4/B6)+(B7+0.5*B8^2)*(B9-B10))/(B8*SQRT (B9-B10)) 15 d 2 *(critical exdividend stock price)= =B14-B8*SQRT(B9-B10) 5

6 16d 1 (dividend-paying)= =(LN(B5/B6)+(B7+0.5*B8^2)*(B9))/(B8*SQRT(B9)) 17d 2 (dividend-paying)= =B16-B8*SQRT(B9) 18a1=a1= =(LN((B3-B11*EXP(-B7*B10))/B6)+(B7+0.5*B8 ^2)*(B9))/(B8*SQRT(B9)) 19a2=a2= =B18-B8*SQRT(B9) 20b1=b1= =(LN((B3-B11*EXP(-B7*B10))/B4)+(B7+0.5*B8 ^2)*(B10))/(B8*SQRT(B10)) 21b2=b2= =B20-B8*SQRT(B10) 22 23C(S t *,T-t;X)= =B4*NORMSDIST(B14)-B6*EXP(-B7*(B9-B10)) *NORMSDIST(B15) 24C(S t *,T-t;X)-S t *-D+X=2.3E-06=B23-B4-B11+B N 1 (a 1 )= =NORMSDIST(B18) 27N 1 (a 2 )= =NORMSDIST(B19) 28N 1 (b 1 )= =NORMSDIST(B20) 29N 1 (b 2 )=0.6598=NORMSDIST(B21) 30N 1 (-b 1 )= =NORMSDIST(-B20) 6

7 31N 1 (-b 2 )=0.3402=NORMSDIST(-B21) 32ρ=ρ= =-SQRT(B10/B9) 33a = a 1 ;b = -b 1 34Φ(a,-b;-ρ)= =phi(-B20,0,-B37) 35Φ(-a,b;-ρ)= =phi(-B18,0,-B36) 36ρab= =((B32*B18-(-B20))*IF(B18>=0,1,-1))/SQRT(B 18^2-2*B32*B18*-B20+(-B20)^2) 37ρba= =((B32*-B20-(B18))*IF(-B20>=0,1,-1))/SQRT (B18^2-2*B32*B18*-B20+(-B20)^2) 38N 2 (a,0;ρab)= =bivarncdf(B18,0,B36) 39N 2 (b,0;ρba)= =bivarncdf(-B20,0,B37) 40δ=0.5=(1-IF(B18>=0,1,-1)*IF(-B20>=0,1,-1))/4 41a = a 2 ;b = b 2 42Φ(a,-b;-ρ)= =phi(-B21,0,-B45) 43Φ(-a,b;-ρ)= =phi(-B19,0,-B44) 44ρab= =((B32*B19-(-B21))*IF(B19>=0,1,-1))/SQRT (B19^2-2*B32*B19*-B21+(-B21)^2) 45ρba= =((B32*-B21-(B19))*IF(-B21>=0,1,-1))/SQRT (B19^2-2*B32*B19*-B21+(-B21)^2) 7

8 46N 2 (a,0;ρab)= =bivarncdf(B19,0,B44) 47N 2 (b,0;ρba)= =bivarncdf(-B21,0,B45) 48δ=0.5=(1-IF(B19>=0,1,-1)*IF(-B21>=0,1,-1))/ N 2 (a 1,-b 1 ;ρ)= =bivarncdf(B18,-B20,B32) 51N 2 (a 2,-b 2 ;ρ)= =bivarncdf(B19,-B21,B32) c(value of European call option to buy one share) =B5*NORMSDIST(B16)-B6*EXP(-B7*B9)*NO RMSDIST(B17) 54 p(value of European put option to sell one share) =-B5*NORMSDIST(-B16)+B6*EXP(-B7*B9)*NO RMSDIST(-B17) 55 c(value of American call option to buy one share) =(B3-B11*EXP(-B7*B10))*(NORMSDIST(B20) +bivarncdf(B18,-B20,-SQRT(B10/B9)))-B6*EXP (-B7*B9)*(NORMSDIST(B21)*EXP(B7*(B9-B10 ))+bivarncdf(B19,-B21,-SQRT(B10/B9)))+B11*EX P(-B7*B10)*NORMSDIST(B21) 8


Download ppt "Appendix 19 A Microsoft Excel Program for Calculating Cumulative Bivariate Normal Density Function ( 19.8.2) By Cheng Few Lee Joseph Finnerty John Lee."

Similar presentations


Ads by Google