# 金融商品設計與評價 hw13 計財系大三 林奕全. Outline  1. Asian option in MC/Control variate  Call(max(A-X,0)/max(S(T)-A,0)  Put(max(A-X,0)/max(A-S(T),0)  2. Lookback.

## Presentation on theme: "金融商品設計與評價 hw13 計財系大三 林奕全. Outline  1. Asian option in MC/Control variate  Call(max(A-X,0)/max(S(T)-A,0)  Put(max(A-X,0)/max(A-S(T),0)  2. Lookback."— Presentation transcript:

Outline  1. Asian option in MC/Control variate  Call(max(A-X,0)/max(S(T)-A,0)  Put(max(A-X,0)/max(A-S(T),0)  2. Lookback option

In MC simulation way

max(A-X,0)  function [ P,CI ] = AsianMCCall1(s0,X,r,T,sigma,NSamples,NRepl )  Payoff=zeros(NRepl,1);  for(i=1:NRepl)  Path=AssetPaths1(s0,r,sigma,T,NSamples,1);  Payoff(i)=max(0,mean(Path(2:(NSamples+1)))-X);  end  [P,aux,CI]=normfit(exp(-r*T)*Payoff);

max(S(T)-A,0)  function [ P,CI ] = AsianMCCall2(s0,X,r,T,sigma,NSamples,NRepl )  Payoff=zeros(NRepl,1);  for(i=1:NRepl)  Path=AssetPaths1(s0,r,sigma,T,NSamples,1);  Payoff(i)=max(0,Path(NSamples+1)- mean(Path(2:(NSamples+1))));  end  [P,aux,CI]=normfit(exp(-r*T)*Payoff);

max(A-X,0)  function [ P,CI ] = AsianMCPut1(s0,X,r,T,sigma,NSamples,NRepl )  Payoff=zeros(NRepl,1);  for(i=1:NRepl)  Path=AssetPaths1(s0,r,sigma,T,NSamples,1);  Payoff(i)=max(0,X-mean(Path(2:(NSamples+1))));  end  [P,aux,CI]=normfit(exp(-r*T)*Payoff);

max(A-S(T),0)  function [ P,CI ] = AsianMCPut2(s0,X,r,T,sigma,NSamples,NRepl )  Payoff=zeros(NRepl,1);  for(i=1:NRepl)  Path=AssetPaths1(s0,r,sigma,T,NSamples,1);  Payoff(i)=max(0,mean(Path(2:(NSamples+1)))- Path(NSamples+1));  end  [P,aux,CI]=normfit(exp(-r*T)*Payoff);

In control variate way

max(A-X,0)  function [ P,CI ] = AsianMCCV( s0,X,r,T,sigma,NSamples,NRepl1,Npilot )  TryPath=AssetPaths1(s0,r,sigma,T,NSamples,Npilot);  Stocksum=sum(TryPath,2);  PP=mean(TryPath(:,2:(NSamples+1)),2);  TryPayoff=exp(-r*T)*max(PP-X,0);  Matcov=cov(Stocksum,TryPayoff);  c=-Matcov(1,2)/var(Stocksum);  dt=T/NSamples;  ExpSum=s0*(1-exp((NSamples+1)*r*dt))/(1-exp(r*dt));

 ControlVars=zeros(NRepl1,1);  for i=1:NRepl1 StockPath=AssetPaths1(s0,r,sigma,T,NSamples,1);  Payoff=exp(- r*T)*max(0,mean(StockPath(2:(NSamples+1)))- StockPath(NSamples+1));  ControlVars(i)=Payoff+c*(sum(StockPath)-ExpSum);  end  [P,aux,CI]=normfit(ControlVars);

max(S(T)-A,0)  function [ P,CI ] = AsianMCCVCall2( s0,X,r,T,sigma,NSamples,NRepl1,Npilot )  TryPath=AssetPaths1(s0,r,sigma,T,NSamples,Npilot);  Stocksum=sum(TryPath,2);  PP=mean(TryPath(:,2:(NSamples+1)),2);  TryPayoff=exp(-r*T)*max(TryPath(NSamples+1)-PP,0);  Matcov=cov(Stocksum,TryPayoff);  c=-Matcov(1,2)/var(Stocksum);  dt=T/NSamples;  ExpSum=s0*(1-exp((NSamples+1)*r*dt))/(1-exp(r*dt));  ControlVars=zeros(NRepl1,1);

 for i=1:NRepl1  StockPath=AssetPaths1(s0,r,sigma,T,NSamples,1);  Payoff=exp(-r*T)*max(0,StockPath(NSamples+1)- mean(StockPath(2:(NSamples+1))));  ControlVars(i)=Payoff+c*(sum(StockPath)-ExpSum);  end  [P,aux,CI]=normfit(ControlVars);

max(X-A,0)  function [ P,CI ] = AsianMCCVPut1( s0,X,r,T,sigma,NSamples,NRepl1,Npilot )  TryPath=AssetPaths1(s0,r,sigma,T,NSamples,Npilot);  Stocksum=sum(TryPath,2);  PP=mean(TryPath(:,2:(NSamples+1)),2);  TryPayoff=exp(-r*T)*max(X-PP,0);  Matcov=cov(Stocksum,TryPayoff);  c=-Matcov(1,2)/var(Stocksum);  dt=T/NSamples;  ExpSum=s0*(1-exp((NSamples+1)*r*dt))/(1-exp(r*dt));  ControlVars=zeros(NRepl1,1);

 for i=1:NRepl1  StockPath=AssetPaths1(s0,r,sigma,T,NSamples,1);  Payoff=exp(-r*T)*max(0,X- mean(StockPath(2:(NSamples+1))));  ControlVars(i)=Payoff+c*(sum(StockPath)-ExpSum);  end  [P,aux,CI]=normfit(ControlVars);

max(A-S(T),0)  function [ P,CI ] = AsianMCCVPut2( s0,r,T,sigma,NSamples,NRepl1,Npilot )  TryPath=AssetPaths1(s0,r,sigma,T,NSamples,Npilot);  Stocksum=sum(TryPath,2);  PP=mean(TryPath(:,2:(NSamples+1)),2);  TryPayoff=exp(-r*T)*max(PP-TryPath(NSamples+1),0);  Matcov=cov(Stocksum,TryPayoff);  c=-Matcov(1,2)/var(Stocksum);  dt=T/NSamples;  ExpSum=s0*(1-exp((NSamples+1)*r*dt))/(1-exp(r*dt));  ControlVars=zeros(NRepl1,1);

 for i=1:NRepl1  StockPath=AssetPaths1(s0,r,sigma,T,NSamples,1);  Payoff=exp(- r*T)*max(0,mean(StockPath(2:(NSamples+1)))- StockPath(NSamples+1));  ControlVars(i)=Payoff+c*(sum(StockPath)-ExpSum);  end  [P,CI]=normfit(ControlVars);

PriceCICI(2)-CI(1) max(A-X,0)-MC3.9810[3.9288,4.0333]0.1045 max(A-X,0)-CV3.9515[3.9301,3.9730]0.0429 max(S(T)-A,0)-MC2.9465[2.9055,2.9874]0.0819 max(S(T)-A,0)-CV2.8972[2.8372,2.9573]0.1201 Compare MC/CV in call

PriceCICI(2)-CI(1) max(X-A,0)-MC2.7375[2.7027,2.7723]0.0696 max(X-A,0)-CV2.7612[2.7396,2.7827]0.0431 max(A-S(T),0)-MC2.0988[2.0728,2.1249]0.0521 max(A-S(T),0)-CV2.0870[2.0256,2.1485]0.1222 Compare MC/CV in Put

LookbackCall1  function [ Payoff ] = LookbackCall1(s0,r,T,sigma,NSamples,NRepl1 )  Payoff=ones(1,NRepl1);  for i=1:NRepl1  Path=AssetPaths1(s0,r,sigma,T,NSamples,1);  Payoff(i)=max(0,Path(NSamples+1)- min(Path(2:(NSamples+1))));  end  Payoff=mean(Payoff);

LookbackPut1  function [ Payoff ] = LookbackPut1(s0,r,T,sigma,NSamples,NRepl1 )  Payoff=ones(1,NRepl1);  for i=1:NRepl1  Path=AssetPaths1(s0,r,sigma,T,NSamples,1);  Payoff(i)=max(0,max(Path(2:(NSamples+1)))- Path(NSamples+1));  end  Payoff=mean(Payoff);

 rand(‘seed’,0)  NRepl1=10000;  NRepl2=20000;  NRepl3=30000;  LookbackCall1(s0,r,T,sigma,NSamples,NRepl1 )  LookbackPut1(s0,r,T,sigma,NSamples,NRepl1 )

100002000030000 Lookback Call7.25567.14537.2604 Lookback Put5.91795.92865.9510 Compare in Lookback call/put

 Put : max(0, Smax – St )  function P = AsianHaltonCall1(S0,X,r,T,sigma,NSamples,NRepl)  Payoff = zeros(1,NRepl);  Path=HaltonPaths(S0,r,sigma,T,NSamples,NRepl);  for i=1:NRepl  Payoff(i) = max(0, max(Path(i,:))- Path(i,NSamples+1));  end  P = mean( exp(-r*T) * Payoff); lookback option in Halton

 S0=50;  X=50;  r=0.1;  T=5/12;  sigma=0.4;  NSamples=5;  NRepl1=10000;  NRepl2=20000;  NRepl3=30000;

 lookbackcalloption10000=AsianHaltonCall1 (S0,X,r,T,sigma,NSamples,NRepl1);  lookbackcalloption20000=AsianHaltonCall1 (S0,X,r,T,sigma,NSamples,NRepl2);  lookbackcalloption30000=AsianHaltonCall1 (S0,X,r,T,sigma,NSamples,NRepl3); 

100002000030000 MC7.25567.14537.2604 Halton 8.0861 8.0750 8.0616 Lookback call in MC/Halton

 lookbackputoption10000=AsianHaltonPut1 (S0,X,r,T,sigma,NSamples,NRepl1);  lookbackputoption20000=AsianHaltonPut1 (S0,X,r,T,sigma,NSamples,NRepl2);  lookbackputoption30000=AsianHaltonPut1 (S0,X,r,T,sigma,NSamples,NRepl3); 

100002000030000 MC5.91795.92865.9510 Halton 6.6060 6.6297 6.6195 Lookback Put in MC/Halton

Download ppt "金融商品設計與評價 hw13 計財系大三 林奕全. Outline  1. Asian option in MC/Control variate  Call(max(A-X,0)/max(S(T)-A,0)  Put(max(A-X,0)/max(A-S(T),0)  2. Lookback."

Similar presentations