楼主: maxth
1568 6

[其他] 帮忙改编个code,谢谢,主要是第二问 [推广有奖]

  • 1关注
  • 0粉丝

本科生

23%

还不是VIP/贵宾

-

威望
0
论坛币
3 个
通用积分
0
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
2731 点
帖子
69
精华
0
在线时间
67 小时
注册时间
2007-7-27
最后登录
2014-5-5

楼主
maxth 发表于 2011-2-1 09:22:17 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
1. (1)Modify the program AmPutLattice (as below) so it applies to calls. Then compute American option prices with parameters asS0=50, K=54, T = 5 months, risk free rate = 3%, and volatility = 30% and with three values for N=1000, 2000, and 5000. Compare your values with the output of blsprice and binprice.


function price = AmPutLattice(S0,K,r,T,sigma,N)
% Precompute invariant quantities
deltaT = T/N;
u=exp(sigma * sqrt(deltaT));
d=1/u;
p=(exp(r*deltaT) - d)/(u-d);
discount = exp(-r*deltaT);
p_u = discount*p;
p_d = discount*(1-p);
% set up S values
SVals = zeros(2*N+1,1);
SVals(N+1) = S0;
for i=1:N
SVals(N+1+i) = u*SVals(N+i);
SVals(N+1-i) = d*SVals(N+2-i);
end
% set up terminal values
PVals = zeros(2*N+1,1);
for i=1:2:2*N+1
PVals(i) = max(K-SVals(i),0);
end
% work backwards
for tau=1:N
for i= (tau+1):2:(2*N+1-tau)
hold = p_u*PVals(i+1) + p_d*PVals(i-1);
PVals(i) = max(hold, K-SVals(i));
end
end
price = PVals(N+1);


(2)Back to the American put with the same parameters and N=5. Use AmPutLattice to determine whether this option is going to be exercised one month before expiration. [Hint: you need to determine for each node on the tree whether it is an "exercise node" or not.]
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

关键词:code COD ODE parameters Volatility

沙发
camel_wangz 发表于 2011-2-1 09:31:59
不懂,帮顶

藤椅
maxth 发表于 2011-2-1 11:19:02
啊,感动哇,谢谢帮顶

板凳
xhschneider 发表于 2011-2-2 12:28:40
it needs to pay, haha!

报纸
maxth 发表于 2011-2-2 22:47:38
呵呵,早上已经把这道题交了,谢谢大家关注哈

地板
maididi 发表于 2011-2-4 13:52:53
这个怎么用啊 看不懂呀!

7
phill 发表于 2011-2-6 21:39:31
as the hint suggests, add another variable to test whether the option is to be excised at each step, then update the payoff

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注jr
拉您进交流群
GMT+8, 2025-12-25 18:12