Skip to Main Content
Mathematica 錦囊妙計
book

Mathematica 錦囊妙計

by Sal Mangano
April 2014
Beginner to intermediate content levelBeginner to intermediate
830 pages
15h 21m
Chinese
GoTop Information, Inc.
Content preview from Mathematica 錦囊妙計
14.9 使用有限差分法(Finite Difference Method)計算 Black-Scholes 公式
|
577
以下計算所使用的是顯式
有限差分法
finite difference method
FDM)。此方法中,衍
生性金融商品
V
j,i-1
的價值將從
V
j+1,i
V
j,i
V
j-1,i
計算而得,原理將於「討論說明」
部分闡述。[Page-579]
本例中,股價的離散格點數目
n
可任意指定,增加格點的數目可提升準確性,但代價是
提高計算時間。以下計算中的格點數目設為 20
股價計算區間應該要包含目前股價,但格點不宜過密,本例所使用的計算區間為 0 至履
約價格的兩倍,由此可算出格點間距
δS
。使用
NestList
指令可建立格點串列,程式碼
中的
#1 + δS &
是一個用來進行逐步疊加的純函數。
接著對股價的格點串列中的各點進行履約動作,以此串列作為初始條件。
X
X
顯式有限差分法的收斂條件是要有足夠大的時間步數,取決於時間步長、股價、波動
性及履約價格。時間步數可以下式獲得(詳細推導請見「延伸資訊」中 Wilmott 所著專
書)
時間步長則是:
在下
pricingFunc
定價 函數中,Γ Δ 兩項將 直接 影響計 算的速 度,因為 這兩
Do
中,Mathematica
ListConvolve
差分 的計算。
Do
迴圈 結束後, 串列
V
內含 選擇權 的價 值,分別 對應 至各股 價格 點,
Interpolation ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Ubuntu for Non-Geeks, 4th Edition

Ubuntu for Non-Geeks, 4th Edition

Rickford Grant, Phil Bull

Publisher Resources

ISBN: 9789863470106