MAAB金融计算试题
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
MATLAB金融计算试题(2014级研究生用)
(上机操作使用)
一、利率期限结构(20分)
已知国债面值是100美元,各期收益率为
试分析其利率期限结构。
MATLAB命令:
bonds=[datenum('04/17/2013') 0 100;
datenum('07/17/2013') 0 100;
datenum('12/31/2014') 0.0175 100;
datenum('11/15/2017') 0.03 100;
datenum('11/15/2022') 0.04 100;
datenum('02/15/2041') 0.0537 100];
yield=[0.0115 0.0118 0.0168 0.0297 0.0401 0.0492]'; settle=datenum('01/17/2013'); %结算日
[zerorates,curvedates]=zbtyield(bonds,yield,settle) datestr(curvedates)
plot(zerorates)
运行结果:
zerorates =
0.0118
0.0302
0.0418
0.0550
curvedates =
735341
735432
735964
737014
738840
745507
ans =
17-Apr-2013
17-Jul-2013
31-Dec-2014
15-Nov-2017
15-Nov-2022
15-Feb-2041
二、期权定价(30分)
若股票现在价格为$50,期权执行价格为$52,无风险利率为0.1,股票波动标准差为0.4,期权的到期日为6个月,且若这一卖权在3.5月时有一次股息支付$2。
(1)使用Black-Scholes定价公式计算欧式卖权和买权的价值; MATLAB命令:
price=50;
strike=52;
rate=0.1;
time=6/12;
volatility=0.4;
[callprice,putprice]=blsprice(price,strike,rate,time,volatility )
运行结果:
callprice =
5.8651
putprice =
5.3290
(2)利用二项式期权定价(二叉树(CRR)模型定价数值解)计算看涨看跌期权价格;
MATLAB命令:
price=50;
strike=52;
rate=0.1;
time=6/12;
increment=1/12;
volatility=0.4;
flag=0;
dividentrate=0;
divident=2;
exdiv=3.5;
[price,option]=binprice(price,strike,rate,time,increment,volati lity,flag,dividentrate,divident,exdiv)
运行结果:
得出二叉树每个交点处的资产价格和期权价值.
price =
50.0000 55.8985 62.5172 69.9441 76.2699 85.6054
96.0836
0 44.7755 50.0326 55.9315 60.5420 67.9524
76.2699
0 0 40.1226 44.8084 48.0575 53.9398
60.5420
0 0 0 35.9790 38.1474 42.8167
48.0575
0 0 0 0 30.2809 33.9873
38.1474
0 0 0 0 0 26.9787
30.2809
0 0 0 0 0 0
24.0366
option =
6.7016 3.9308 1.7652 0.4598 0 0 0
0 9.6686 6.2275 3.1393 0.9412 0 0
0 0 13.3762 9.5132 5.4560 1.9263 0
0 0 0 17.5811 13.8526 9.1833 3.9425
0 0 0 0 21.7191 18.0127 13.8526
0 0 0 0 0 25.0213 21.7191
0 0 0 0 0 0 27.9634
由结果可知,option第一行第一列就是看跌期权价格,该期权价格为
6.7016元。
MATLAB命令:
price=50;
strike=52;
rate=0.1;
time=6/12;
increment=1/12;
volatility=0.4;
flag=1;
dividentrate=0;
divident=2;
exdiv=3.5;
[price,option]=binprice(price,strike,rate,time,increment,volati lity,flag,dividentrate,divident,exdiv)
运行结果:
得出二叉树每个交点处的资产价格和期权价值.
price =
50.0000 55.8985 62.5172 69.9441 76.2699 85.6054 96.0836
0 44.7755 50.0326 55.9315 60.5420 67.9524 76.2699
0 0 40.1226 44.8084 48.0575 53.9398 60.5420
0 0 0 35.9790 38.1474 42.8167 48.0575
0 0 0 0 30.2809 33.9873 38.1474
0 0 0 0 0 26.9787 30.2809
0 0 0 0 0 0 24.0366
option =
4.9996 7.8792 12.0864 17.9441 2
5.1294 34.0369 44.0836