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 錦囊妙計
582
|
第十四章
編譯完成後,僅需 18.5 毫秒便可對 10 個不同履約價格進行定價。[Page-584]
討論說明
americanPutCompiled
函數回傳 2 個緊實陣列(packed array),第一個為股價格點,第
二個則是各股價所對應的美式選擇權價格,使用 Mathematica 提供的
Interpolation
指
令建立內插函數便可取得非格點的中間股價之選擇權價格。
藉由檢查
americanPutCompiled
的第 4 個元素,可得知此函數是經過充分編譯的,因為
第 4 個元素內含的所有元素均是數值型態。
本例所用的美式選擇權定價演算法屬於自由邊界值問題(free boundary value problem)
的線性互補形式(linear complementarity),參數
a
、
nn
、
T0
與
mm
(及其對應的
s
與
h
)
用來設定格點的分布,
a
與
nn
決定空間(即股價)格點,
T0
與
mm
則決定時間格點。對
顯式數值問題而言,兩方向的格點分布須滿足特定條件,否則數值運算將無法收斂至正
確解,完全顯式的數值方法須滿足
alpha=s/h^2<=1/2
不等式,這意味著如果空間的步長
減為十分之一,則時間步長便須減為百分之一,這並非精確度問題,而是穩定性問題。
舉例而言,如果
mm
值降低為 15,則
alpha
不等式便無法成立,數值解的不穩定性便十
分明顯,若降低至 10 甚至是 5,求解過程更是一場災難。傳統的美式選擇權計算定價時
使用的是二項樹法(binominal tree),但卻存
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
人工智能技术与大数据

人工智能技术与大数据

Posts & Telecom Press, Anand Deshpande, Manish Kumar

Publisher Resources

ISBN: 9789863470106