Download presentation
Presentation is loading. Please wait.
Published byRudolph Webb Modified over 8 years ago
1
金融商品設計與評價 HW5 潘承瑄 101071035
2
TriEurPut S0=50; X=50; r=0.04879; T=6/12; sigma=0.2; N=8; lamda=1.41421; [price, lattice] = TriEurCall(S0,X,r,T,sigma,N,lamda) Command Window
3
function [price, lattice] = TriEurPut(S0,X,r,T,sigma,N,lamda) deltaT = T/N; u=exp(lamda*sigma*sqrt(deltaT)); d=1/u; pu=1/(2*lamda^2)+(r-(sigma^2/2))*sqrt(deltaT)/(2*lamda*sigma); pm=1-1/(lamda^2); pd=1-pu-pm; lattice = zeros(N+1,2*N+1); for j=1:N+1 lattice(N+1,j)=max(0, X-S0*(d^(N-j+1))); end for j=N+2:2*N+1 lattice(N+1,j)=max(0, X-S0*(u^(j-N-1))); end for i=N-1:-1:0 for j=1:2*i+1 lattice(i+1,j) = exp(-r*deltaT)*(pd*lattice(i+2,j)+pm*lattice(i+2,j+1)+pu*lattice(i+2,j+2)); end price=lattice(1,1); TriEurPut
4
答案
5
TriAmPut S0=50; X=50; r=0.04879; T=6/12; sigma=0.2; N=8; lamda=1.41421; [price, lattice] = TriAmPut(S0,X,r,T,sigma,N,lamda) Command Window
6
function [price, lattice] = TriAmPut(S0,X,r,T,sigma,N,lamda) deltaT = T/N; u=exp(lamda*sigma*sqrt(deltaT)); d=1/u; pu=1/(2*lamda^2)+(r-(sigma^2/2))*sqrt(deltaT)/(2*lamda*sigma); pm=1-1/(lamda^2); pd=1-pu-pm; lattice = zeros(N+1,2*N+1); for j=1:N+1 lattice(N+1,j)=max(0, X-S0*(d^(N-j+1))); end for j=N+2:2*N+1 lattice(N+1,j)=max(0, X-S0*(u^(j-N-1))); end for i=N-1:-1:0 for j=1:2*i+1 lattice(i+1,j) = max(X-S0*(d^(i+1)*u^j),... exp(-r*deltaT)*(pd*lattice(i+2,j)+pm*lattice(i+2,j+1)+pu*lattice(i+2,j+2))); end price=lattice(1,1); TriAmPut
7
答案
8
S0=50; X=52; r=0.1; T=5/12; sigma=0.4; NRepl=1000; [Price1, CI1] = BlsMCEurCall(S0,X,r,T,sigma,NRepl); >> [Price2, CI2] = BlsMCEurCall2(S0,X,r,T,sigma,NRepl); Compare E[max{ST-X,0}]&max{E[ST]-X,0} Command Window
9
function [Price, CI] = BlsMCEurCall(S0,X,r,T,sigma,NRepl) nuT = (r - 0.5*sigma^2)*T; siT = sigma * sqrt(T); DiscPayoff = exp(-r*T) * max( 0, S0*exp(nuT+siT*randn(NRepl,1)) - X); [Price, VarPrice, CI] = normfit(DiscPayoff); E[max{ST-X,0}]
10
function [Price, CI] = BlsMCEurCall2(S0,X,r,T,sigma,NRepl) nuT = (r - 0.5*sigma^2)*T; siT = sigma * sqrt(T); ST= S0*exp(nuT+siT*randn(NRepl,1)); [STPrice, VarPrice, CI] = normfit(ST); Price = exp(-r*T) * max( 0, STPrice- X); max{E[ST]-X,0}
11
答案 >> Price1 Price1 = 5.6384 >> Price2 Price2 = 0.0387 =>E[max{ST-X,0}] 和 max{E[ST]-X,0} 不同
12
S0=50; X=52; r=0.1; T=5/12; sigma=0.4; NRepl=1000; [Price, CI] = BlsMCEurPut(S0,X,r,T,sigma,NRepl) Command Window BlsMCEurPut
13
% BlsMCEurPut.m function [Price, CI] = BlsMCEurPut(S0,X,r,T,sigma,NRepl) nuT = (r - 0.5*sigma^2)*T; siT = sigma * sqrt(T); DiscPayoff = exp(-r*T) * max( 0, X-S0*exp(nuT+siT*randn(NRepl,1))); [Price, VarPrice, CI] = normfit(DiscPayoff); BlsMCEurPut
14
答案 Price = 5.4551 CI = 5.0446 5.8656
Similar presentations
© 2024 SlidePlayer.com Inc.
All rights reserved.