1 / 20

金融商品設計與評價 hw11

金融商品設計與評價 hw11. 計財系大三 林奕全. Outline. 1. Down-and-in put 2.closed-form for other barrier option ( 以 Up-and-in/out call 為例 ) - 解析解 -MC (Up-and-in/out call) -MC( BlsEurCall ). AssetPaths1. function SPaths = AssetPaths1( s0,r,sigma,T,NSteps,NRepl )

Download Presentation

金融商品設計與評價 hw11

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 金融商品設計與評價hw11 計財系大三 林奕全

  2. Outline • 1. Down-and-in put • 2.closed-form for other barrier option (以 Up-and-in/out call為例) -解析解 -MC(Up-and-in/out call) -MC(BlsEurCall)

  3. AssetPaths1 • function SPaths = AssetPaths1( s0,r,sigma,T,NSteps,NRepl ) • SPaths=zeros(NRepl,1+NSteps); • SPaths(:,1)=s0; • dt=T/NSteps; • nudt=(r-0.5*sigma^2)*dt; • sidt=sigma*sqrt(dt); • for i=1:NRepl • for j=1:NSteps • SPaths(i,j+1)= SPaths(i,j)*exp(nudt+sidt*randn); • end • end

  4. DOPutMC(Down-and-in put) • function [P,CI,NCrossed ] =DOPutMC( s0,X,r,T,sigma,sb,NSteps,NRepl) • Payoff=zeros(NRepl,1); • NCrossed=0; • for i=1:NRepl • Path=AssetPaths1(s0,r,sigma,T,NSteps,1); • crossed=any(Path<=sb);

  5. if crossed==0 • Payoff(i)=0; • NCrossed=NCrossed+1; • else • Payoff(i)=max(0,X-Path(NSteps+1)); • end • end • [P,aux,CI]=normfit(exp(-r*T)*Payoff)

  6. s0=50; • X=50; • r=0.1; • T=2/12; • sigma=0.4; • sb=40; • NSteps=60; • NRepl=50000; • randn('seed',0); • [D0PutMC,CI,NCrossed]=DOPutMC(s0,X,r,T,sigma,sb,NSteps,NRepl); • D0PutMC • CI • NCrossed

  7. BlsMcEurPut • 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(X-s0*exp(nuT+siT*randn(NRepl,1)),0); • [Price,Varprice,CI]=normfit(DiscPayoff);

  8. s0=50; • X=50; • r=0.1; • T=2/12; • sigma=0.4; • NRepl1=50000; • randn('seed',0); • [MC50000,CI50000]=BlsMcEurPut(s0,X,r,T,sigma,NRepl)

  9. UICall formula

  10. UICall • function [UICallprice, UOCallprice]=UICall (s0,X,r,T,sigma,sb ) • lamda=(r/(sigma^2))+1/2; • y1=(log(sb/s0)+lamda*(sigma^2)*T)/(sigma*sqrt(T)); • x1=(log(s0/sb)+lamda*(sigma^2)*T)/(sigma*sqrt(T)); • y=(log(sb^2/(s0*X))+lamda*(sigma^2)*T)/(sigma*sqrt(T));

  11. UICallprice=max(0,s0*normcdf(x1)-X*exp(-r*T)*normcdf(x1-sigma*sqrt(T))-s0*((sb/s0)^(2*lamda))*(normcdf(-y)-normcdf(-y1))+X*exp(-r*T)*((sb/s0)^(2*lamda-2))*(normcdf(-y+sigma*sqrt(T))-normcdf(-y1+sigma*sqrt(T))));UICallprice=max(0,s0*normcdf(x1)-X*exp(-r*T)*normcdf(x1-sigma*sqrt(T))-s0*((sb/s0)^(2*lamda))*(normcdf(-y)-normcdf(-y1))+X*exp(-r*T)*((sb/s0)^(2*lamda-2))*(normcdf(-y+sigma*sqrt(T))-normcdf(-y1+sigma*sqrt(T)))); • UOCallprice=blsprice(s0,X,r,T,sigma)-UICallprice; • end

  12. s0=50; • X=50; • r=0.1; • T=2/12; • sigma=0.4; • sb=70; • NStep=60; • NRepl=50000; • sb1=sb*exp(0.5826*0.4*sqrt(1/12/30)); • [UICallprice, UOCallprice]=UICall (s0,X,r,T,sigma,sb1 )

  13. UICallprice = • 0.7103 • UOCallprice = • 2.9465

  14. UICallMC • function [P,CI,NCrossed ] =UICallMC( s0,X,r,T,sigma,sb,NSteps,NRepl) • Payoff=zeros(NRepl,1); • NCrossed=0; • for i=1:NRepl • Path=AssetPaths1(s0,r,sigma,T,NSteps,1); • crossed=any(Path>=sb); • if crossed==0 • Payoff(i)=0; • NCrossed=NCrossed+1; • else • Payoff(i)=max(0,Path(NSteps+1)-X); • end • end • [P,aux,CI]=normfit(exp(-r*T)*Payoff)

  15. s0=50; • X=50; • r=0.1; • T=2/12; • sigma=0.4; • sb=70; • NRepl=50000; • NSteps=60; • randn('seed',0); • [P,CI,NCrossed ] =UICallMC( s0,X,r,T,sigma,sb,NSteps,NRepl)

  16. UOCallMC • function [P,CI,NCrossed ] =UOCallMC( s0,X,r,T,sigma,sb,NSteps,NRepl) • Payoff=zeros(NRepl,1); • NCrossed=0; • for i=1:NRepl • Path=AssetPaths1(s0,r,sigma,T,NSteps,1); • crossed=any(Path>=sb); • if crossed==0 • Payoff(i)=max(0,Path(NSteps+1)-X); • else • Payoff(i)=0; • NCrossed=NCrossed+1; • end • end • [P,aux,CI]=normfit(exp(-r*T)*Payoff)

  17. s0=50; • X=50; • r=0.1; • T=2/12; • sigma=0.4; • sb=70; • NRepl=50000; • NSteps=60; • randn('seed',0); • [P,CI,NCrossed ] =UOCallMC( s0,X,r,T,sigma,sb,NSteps,NRepl)

  18. BlsMcEurCall( • 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(s0*exp(nuT+siT*randn(NRepl,1))-X,0); • [Price,Varprice,CI]=normfit(DiscPayoff);

More Related