1 / 16

金融商品設計與評價 hw10

金融商品設計與評價 hw10. 計財系大三 林奕全. Outline. 1.CBValue - Putable -Callable - Putable + Callable 2. - Rand+BoxMuller - Halton+BoxMuller:Eur Put. Putable. function [ price,lattice ] = CBValuePut ( s0,r,T,sigma,N,Q,I,P,tau ) deltaT =T/N; u=exp(sigma* sqrt ( deltaT )); d=1/u;

Download Presentation

金融商品設計與評價 hw10

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. 金融商品設計與評價hw10 計財系大三 林奕全

  2. Outline • 1.CBValue • -Putable • -Callable • - Putable+ Callable • 2. • -Rand+BoxMuller • -Halton+BoxMuller:Eur Put

  3. Putable • function [ price,lattice ] = CBValuePut( s0,r,T,sigma,N,Q,I,P,tau ) • deltaT=T/N; • u=exp(sigma*sqrt(deltaT)); • d=1/u; • p=(exp(r*deltaT)-d)/(u-d); • lattice=zeros(N+1,N+1); • for j=0:N • lattice(N+1,j+1)=max(I/Q,s0*(u^j)*(d^(N-j))); • end

  4. for i=N-1:-1:0 • for j=0:i • lattice(i+1,j+1)=max(s0*u^(j)*d^(i-j),exp(-r*deltaT)*(p*lattice(i+2,j+2)+(1-p)*lattice(i+2,j+1))); • if i==tau-1 • lattice(i+1,j+1)=max(lattice(i+1,j+1),P/Q); • end • end • end • price=lattice(1,1)*Q;

  5. >> CBValue(35, 0.02, 5, 0.3, 100, 2500, 100000) • ans = • 1.1234e+05 • >> CBValuePut(35, 0.02, 5, 0.3, 100, 2500, 100000,102000,50) • ans = • 1.1399e+05

  6. Callable • function [ price,lattice ] = CBValueCall( s0,r,T,sigma,N,Q,I,C ) • deltaT=T/N; • u=exp(sigma*sqrt(deltaT)); • d=1/u; • p=(exp(r*deltaT)-d)/(u-d); • lattice=zeros(N+1,N+1);

  7. for j=0:N • lattice(N+1,j+1)=max(I/Q,s0*(u^j)*(d^(N-j))); • end • for i=N-1:-1:0 • for j=0:i • lattice(i+1,j+1)=max(s0*u^(j)*d^(i-j),min(exp(-r*deltaT)*(p*lattice(i+2,j+2)+(1-p)*lattice(i+2,j+1)),C/Q)); • end • end • price=lattice(1,1)*Q;

  8. >> CBValue(35, 0.02, 5, 0.3, 100, 2500, 100000) • ans = • 1.1234e+05 • >> CBValueCall(35, 0.02, 5, 0.3, 100, 2500, 100000,102000) • ans = • 9.8619e+04

  9. Putable+ Callable • function [ price,lattice ] = CBValueCallPut( s0,r,T,sigma,N,Q,I,C,P,tau ) • deltaT=T/N; • u=exp(sigma*sqrt(deltaT)); • d=1/u; • p=(exp(r*deltaT)-d)/(u-d); • lattice=zeros(N+1,N+1); • for j=0:N • lattice(N+1,j+1)=max(I/Q,s0*(u^j)*(d^(N-j))); • end

  10. for i=N-1:-1:0 • for j=0:i • lattice(i+1,j+1)=max(s0*u^(j)*d^(i-j),min(exp(-r*deltaT)*(p*lattice(i+2,j+2)+(1-p)*lattice(i+2,j+1)),C/Q)); • if i==tau-1 • lattice(i+1,j+1)=max(lattice(i+1,j+1),P/Q); • end • end • end • price=lattice(1,1)*Q;

  11. >> CBValue(35, 0.02, 5, 0.3, 100, 2500, 100000) • ans = 1.1234e+05=112,340 • >> CBValuePut(35, 0.02, 5, 0.3, 100, 2500, 100000,102000,50) • ans = 1.1399e+05=113,990 • >> CBValueCall(35, 0.02, 5, 0.3, 100, 2500, 100000,102000) • ans = 9.8619e+04=98,619 • >> CBValueCallPut(35, 0.02, 5, 0.3, 100, 2500, 100000,102000,102000,50) • ans = 1.0002e+05=100,020

  12. Halton+BoxMuller:Eur Put • function Seq = GetHalton( HowMany,Base) • Seq=zeros(HowMany,1); • NumBits=1+ceil(log(HowMany)/log(Base)); • VetBase=Base.^(-(1:NumBits)); • WorkVet=zeros(1,NumBits); • for i=1:HowMany • j=1; • ok=0;

  13. while ok==0 • WorkVet(j)=WorkVet(j)+1; • if WorkVet(j)<Base • ok=1; • else • WorkVet(j)=0; • j=j+1; • end • end • Seq(i)=dot( WorkVet,VetBase); • end

  14. function Price = BlshaltonEurPut(s0,X,r,T,sigma,Npoints,Base1,Base2) • nuT=(r-0.5*sigma^2)*T; • siT=sigma*sqrt(T); • H1=GetHalton(ceil(Npoints/2),Base1); • H2=GetHalton(ceil(Npoints/2),Base2); • Vlog=sqrt(-2*log(H1)); • Norm1=Vlog.*cos(2*pi*H2); • Norm2=Vlog.*sin(2*pi*H2); • Norm=[Norm1;Norm2]; • DiscPayoff=exp(-r*T)*max(0,X-s0*exp(nuT+siT*Norm)); • Price=mean(DiscPayoff);

  15. s0=50; • X=52; • r=0.1; • sigma=0.4; • Nrepl=5000; • T=5/12; • Base11=2; • Base12=7; • [Call,Put]=blsprice(s0,X,r,T,sigma); • Halton27=BlshaltonEurPut(s0,X,r,T,sigma,Nrepl,Base11,Base12); • Put • Halton27

More Related