28
金金金金金金金金金 hw13 金金金金金 金金金

金融商品設計與評價 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

Embed Size (px)

Citation preview

Page 1: 金融商品設計與評價 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

金融商品設計與評價 hw13

計財系大三 林奕全

Page 2: 金融商品設計與評價 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

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

Page 3: 金融商品設計與評價 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

In MC simulation way

Page 4: 金融商品設計與評價 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

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);

Page 5: 金融商品設計與評價 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

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);

Page 6: 金融商品設計與評價 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

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);

Page 7: 金融商品設計與評價 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

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);

Page 8: 金融商品設計與評價 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

In control variate way

Page 9: 金融商品設計與評價 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

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));

Page 10: 金融商品設計與評價 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

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);

Page 11: 金融商品設計與評價 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

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);

Page 12: 金融商品設計與評價 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

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);

Page 13: 金融商品設計與評價 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

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);

Page 14: 金融商品設計與評價 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

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);

Page 15: 金融商品設計與評價 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

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);

Page 16: 金融商品設計與評價 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

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);

Page 17: 金融商品設計與評價 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

Price CI CI(2)-CI(1)

max(A-X,0)-MC 3.9810 [3.9288,4.0333] 0.1045

max(A-X,0)-CV 3.9515 [3.9301,3.9730] 0.0429

max(S(T)-A,0)-MC

2.9465 [2.9055,2.9874] 0.0819

max(S(T)-A,0)-CV

2.8972 [2.8372,2.9573] 0.1201

Compare MC/CV in call

Page 18: 金融商品設計與評價 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

Price CI CI(2)-CI(1)

max(X-A,0)-MC 2.7375 [2.7027,2.7723] 0.0696

max(X-A,0)-CV 2.7612 [2.7396,2.7827] 0.0431

max(A-S(T),0)-MC

2.0988 [2.0728,2.1249] 0.0521

max(A-S(T),0)-CV

2.0870 [2.0256,2.1485] 0.1222

Compare MC/CV in Put

Page 19: 金融商品設計與評價 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

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);

Page 20: 金融商品設計與評價 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

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);

Page 21: 金融商品設計與評價 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

rand(‘seed’,0) NRepl1=10000; NRepl2=20000; NRepl3=30000;

LookbackCall1(s0,r,T,sigma,NSamples,NRepl1 )

LookbackPut1(s0,r,T,sigma,NSamples,NRepl1 )

Page 22: 金融商品設計與評價 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

10000 20000 30000

Lookback Call 7.2556 7.1453 7.2604

Lookback Put 5.9179 5.9286 5.9510

Compare in Lookback call/put

Page 23: 金融商品設計與評價 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

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

Page 24: 金融商品設計與評價 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

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

Page 25: 金融商品設計與評價 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

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);

Page 26: 金融商品設計與評價 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

10000 20000 30000

MC 7.2556 7.1453 7.2604

Halton 8.0861 8.0750 8.0616

Lookback call in MC/Halton

Page 27: 金融商品設計與評價 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

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);

Page 28: 金融商品設計與評價 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

10000 20000 30000

MC 5.9179 5.9286 5.9510

Halton 6.6060 6.6297 6.6195

Lookback Put in MC/Halton