Skip to Content
Mathematica 錦囊妙計
book

Mathematica 錦囊妙計

by Sal Mangano
April 2014
Beginner 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.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Mathematica Cookbook

Mathematica Cookbook

Sal Mangano

Publisher Resources

ISBN: 9789863470106