http://ishare.iask.sina.com.cn/f/22460955.html

 
http://ishare.iask.sina.com.cn/f/15233361.html
 

==========================================================================
Newton Raphson 法
==========================================================================

Function GImpliedVolatilityNR(CallPutFlag As String, S As Double, X As Double, T As Double, r As Double, b As Double, cm As Double, epsilon As Double)

 Dim vi As Double, ci As Double
 Dim vegai As Double
 Dim minDiff As Double

 'Manaster and Koehler seed value ( vi)
 vi = Sqr(Abs(Log(S / X) + r * T) * 2 /
 ci = GBlackScholes(CallPutFlag , S, X, T, r, b, vi )
 vegai = GVega(S, X, T, r, b, vi)
 minDiff = Abs(cm — ci )

 While Abs(cm — ci) >= epsilon And Abs(cm — ci)   vi = vi — ( ci — cm) / vegai
  ci = GBlackScholes(CallPutFlag , S, X, T, r, b, vi)
  vegai = GVega(S, x, T, r, b, vi )
  minDiff = Abs(cm — ci )
 Wend

 If Abs(cm — ci)   GImpliedVolatilityNR = vi
 Else
  GImpliedVolatilityNR = "NA"
 End If

End Function

==========================================================================
二分逼近法
==========================================================================

Function GBlackScholesImpVolBisection(CallPutFlag As String, S As Double, X As Double, T As Double, r As Double, b As Double, cm As Double) As Variant
 Dim vLow As Double, vHigh As Double, vi As Double
 Dim cLow As Double, cHigh As Double, epsilon As Double
 Dim counter As Integer
 
 vLow = 0.005
 vHigh = 4
 epsilon = le-08
 cLow = GBlackScholes ( CallPutFlag , S, X, T, r, b, vLow)
 cHigh = GBlackScholes ( CallPutFlag , S, X, T, r, b, vHigh)
 counter = 0
 vi = vLow + (cm — cLow ) * (vHigh — vLow) / ( cHigh — cLow)

 While Abs(cm — GBlackScholes ( CallPutFlag , S, X, T, r, b, vi )) > epsilon
  counter = counter + 1
  
  If counter = 100 Then
   GBlackScholesImpVolBisection
   Exit Function
  End If
  
  If GBlackScholes ( CallPutFlag , S, X, T, r, b, vi )    vLow = vi
  Else
   vHigh = vi
  End If

  cLow = GBlackScholes ( CallPutFlag , S, X, T, r, b, vLow)
  cHigh = GBlackScholes ( CallPutFlag , S, X, T, r, b, vHigh )
  vi = vLow + (cm — cLow ) * (vHigh — vLow) / ( cHigh — cLow)
 Wend

 GBlackScholesImpVolBisection = vi
End Function

==========================================================================
Corrado, C.J. & T.W. Miller
==========================================================================

CORRADO, C. J., AND T. W MILLER (1996a): "A Note on a Simple, Accurate
Formula to Compute Implied Standard Deviations," Journal of
Banking and Finance, 20,595-603.
(1996b): "Volatility Without Tears," Risk Magazine, 9(7).

https://skydrive.live.com/?cid=BDF79758C54B0530#cid=BDF79758C54B0530&id=BDF79758C54B0530%21749

 

  


arrow
arrow
    全站熱搜
    創作者介紹
    創作者 A95297 的頭像
    A95297

    Encomium Moriae

    A95297 發表在 痞客邦 留言(0) 人氣()