Você está na página 1de 8

Assignment for Numeri

al Methods
CFA Group

Enri o Chini, Mar o Robbe, Edoardo Si ardi

Mar h 20th , 2007


We are given to analyze the delta hedging strategy performed in the
previous assignment but this time onsidering the ase of a diusion pro ess
with jumps for the underlying.
In order to justify the de ision made during the simulation pro edure, we
rstly report the ode used for the algorithm and then we omment the most
interesting part together with the derived results

%%%%%%%%%%%%%JUMP%%%%%%%%%%%%%%%

l ; lear all; lose all


PathNumb=1000; %number of path simulated
n=84; %number of step (max hedging: daily hedging)
T=0.25; %time of evaluation of the hedging strategy
Mu=0.1; %drift of the underlying
R=0.1; %return
sigma=0.2; %volatility
K=90; %strike pri e
S=zeros(PathNumb,n+1); %preallo ating
S(:,1)=90; %pri e of the underlying in t=0
Ve tordays=[84 28 7 1℄; %days between ea h step
ases=length(Ve tordays); %number of hedging strategies to be evaluated

%------------------
%%%JUMPS GENERATOR
%------------------
jump_impa t=5; %eta
lambda=16; %intensity

%----METHOD 1: Conditional simulation


% nj=poissrnd(lambda*T);%generate the number of jumps in T.
% tj=floor(unifrnd(1,n,nj,1)); %time o uren y of jumps
% tj=sort(tj);
%End of METOHD1

%METHOD 2: Countdown simulation


tj(1,1)=-(1/lambda)*log(unifrnd(0,1));
i=1
while tj(i,1)<T
tj(i+1,1)=tj(i,1)-(1/lambda)*log(unifrnd(0,1));
i=i+1;
end
tj(end)=[℄; %delete last term be ause it's > T
tj=floor(tj.*(n/T));
nj=length(tj);
%End of METOHD2

%eliminate multiple jumps in the same day

tj_ ut=tj;
ut=0;
for i=1:nj-1
if tj_ ut(i- ut)==tj_ ut(i- ut+1)
tj_ ut(i- ut)=[℄;
ut= ut+1;

1
end
end

%eliminate jumps in t=0


if tj_ ut(1)==0
tj_ ut(1)=[℄;
ut= ut+1;
end

%matrix jumps generation


jump_matrix=zeros(1,n+1);
tj_ ut(:,2)=normrnd(0,1,(nj- ut),1)*jump_impa t;
for row=1:size(tj_ ut,1)
jump_matrix(1,tj_ ut(row,1))=tj_ ut(row,2);
end

jump_matrix=repmat(jump_matrix,PathNumb,1);

%%%END OF JUMPS GENERATION

for k=1:2:PathNumb
%re all the fun tion "Normgen" to generated normal returns
[Sbm1 Sbm2℄= Normgen(n);
for i=1:n
S(k,i+1)=max(S(k,i) * ((1+Mu*(T/n))+(sigma*((T/n)^0.5)*Sbm1(i)))+...
jump_matrix(k,i+1),1); %Euler dis retization
S(k+1,i+1)=max(S(k+1,i) * ((1+Mu*(T/n))+(sigma*((T/n)^0.5)*Sbm2(i)))+...
jump_matrix(k+1,i+1),1);
end
end

figure(10) plot(S'); ylabel('Asset pri e'); xlabel('time(days)');


xlim([0 85℄); OptPayoff= max(S(:,n+1)-K,0);

%generate the time matrix


k=linspa e(T,0,n+1); time = repmat(k,PathNumb,1);

% al ulate pri e and delta of the option


[delta all,deltaput℄ = blsdelta(S,K,R,time,sigma);
pri emonte arlo=mean(OptPayoff)*exp(-R*T); %if Mu=r is the same as BS
[ allpri e,putpri e℄ = blspri e(S,K,R,time,sigma);
%generate the starting value ve tor of the portfolio
[Portfolio,p℄=BlsPri e(S(:,1),K,R,T,sigma);

%No hedging
Portfolio=Portfolio(1,1).*exp(R.*time);
Error=Portfolio(:,1)*exp(R*T)-OptPayoff(:,1);
Result(1)=mean(abs(Error)); figure(20) subplot(1+ ases,1,1)
hist(Error,50); title('Errors with No
hedging','FontSize',12,'FontWeight','bold');

%Hedging with different steps


for k=1: ases
days=Ve tordays(k);
for i=1+days:days:n+1 %Delta hedging strategy
Portfolio(:,i)= delta all(:,i-days).*S(:,i) + ...
(Portfolio(:,i-days)-S(:,i-days).*delta all(:,i-days)).*exp(R*(T*days/n));

delta=delta all(:,i-days); %mantain same delta for days between 2 hedgings


if i<n+1
for l=i+1:i+days-2

2
Portfolio(:,l)= delta.*S(:,l) + (Portfolio(:,l-days)-...
S(:,l-days).*delta).*exp(R*(T*days/n));
end
end
end
Error(:,k+1)= Portfolio(:,n+1)-OptPayoff(:,1);
figure(20)
subplot(1+ ases,1,k+1)
hist(Error(:,k+1),50);
title(['Errors in hedging every ',int2str(days),' days'℄,...
'FontSize',11,'FontWeight','bold');
Result(k+1)= mean(abs(Error(:,k+1)));

errorj(:,:,k)=Portfolio- allpri e; %ERROR%%%%%


MAE(:,:,k)=mean(errorj(:,:,k));
end

figure(30); boxplot(Error); title ('Boxplot of


errors','FontSize',12,'FontWeight','bold'); set(g a,'XTi k',[1 2 3
4 5 6 7℄,...
'XTi kLabel',{'No hedging','single h.','monthly h.','weekly h.','daily h.'});
xlabel('Hedging strategies','FontSize',12);

figure(40) plot(Result,'b.-'); set(g a,'XTi k',[1 2 3 4 5 ℄,...


'XTi kLabel',{'no hedging','single h.','monthly h.','weekly h.','daily h.'});
title('Mean Absolute Error','FontSize',12,'FontWeight','bold')

%Plot the first five Jumps,delta, and sto ks


for m=1:3 figure(59+m) subplot(5,1,1); plot(jump_matrix(m,:));
title('jumps','FontSize',12,'FontWeight','bold'); xlim([0 85℄);
subplot(5,1,2); plot(delta all(m,:));
title('delta','FontSize',12,'FontWeight','bold'); xlim([0 85℄);
subplot(5,1,3); plot(S(m,:));
title('underlying','FontSize',12,'FontWeight','bold'); xlim([0
85℄); subplot(5,1,4); plot( allpri e(m,:));
title('Call','FontSize',12,'FontWeight','bold'); xlim([0 85℄);
subplot(5,1,5); plot(errorj(m,:));
title('Error','FontSize',12,'FontWeight','bold'); xlim([0 85℄);
xlabel('time(days)','FontSize',12);

end

Regarding the parameter initialization we have to stress the fa t that we


hose the value of η , i.e. the impa t fa tor, fair enough to appre iate, also
from a visual point of view, the o urren e of jumps during the development
of the ontinuous pro ess. This has taken in onsideration also the amplitude
of the time interval onsidered of 84 days. Similar onsiderations has driven
the hoi e of jump intensity λ (also imaginable as the frequen y of jumps)
to a value of 16, as to a ount for an expe ted number of jumps equal to
4 quarterly. For the ounting pro ess this means the hoi e of a Poisson
distribution su h that
E[N (t)] = λ
For the remaining parameters we use the same values as in previous assi-
gnment but with an initial value of the underlying equals to 90 (the strike),

3
130

120

110

100
Asset price

90

80

70

60
0 10 20 30 40 50 60 70 80
time(days)

Figura 1: Path simulation

as to better evaluate the behaviour of the hedging strategy for the ases of
maximum sensitivity of delta to underlying movements.
Coming to the result, we give an idea of the pro ess simulation in the
gure 1. We have to say that the pi ture is referred to an algorithm based on
the ountdown method, even if the ode for an alternative te hnique, named
onditional simulation, is given in the ode as well.
The real performan e of the delta hedging strategy are shown in the
pi ture 2, where the P&L histogram displays that the in reasing hedging
frequen y has no full positive ee t on the results, the opposite ase respe t
to that of ontinuous pro ess without jumps.
The overall result, this time in absolute terms, is shown in pi ture 3,
where it is more evident that the error given by the strategy is not able to
redu e even in ase of daily adjustment of the hedging weights. We re all
that for previous assignment, where simple diusion pro esses were taken
into a ount, this Mean Absolute Error was learly dire ted towards zero.
The histogram of the errors is indeed negatively skewed, having thus most
of the errors a negative sign. This is probably due to the way we built the
repli ating portfolio, adapted to a pure GBM pro ess and then rebalan ed
through the B&S delta. That does not hold anymore when the underlying
follows a mixed jump diusion model. In this ase, when we introdu e the
Poisson pro ess representing the jumps we are a tually in reasing the volati-
lity of the sto k, that is in reasing the nal payo of our all option. Given

4
Errors with No hedging
1000

500

0
−30 −25 −20 −15 −10 −5 0 5 10
Errors in hedging every 84 days
100

50

0
−16 −14 −12 −10 −8 −6 −4 −2 0 2 4
Errors in hedging every 28 days
100

50

0
−14 −12 −10 −8 −6 −4 −2 0 2 4
Errors in hedging every 7 days
100

50

0
−8 −7 −6 −5 −4 −3 −2 −1 0 1
Errors in hedging every 1 days
100

50

0
−6 −5 −4 −3 −2 −1 0

Figura 2: P&L histograms

that, sin e we are short on the all option our error will be mostly negative
other things being equal. Also the B&S delta we are using to hedge does not
take into a ount the in reased volatility we introdu e with the jumps, and
then as long as we use the B&S delta to hedge we will underestimate the
sensitivity of the pri e and hedge with a lower portion of the underlying we
would a tually need. Finally given the error average and the hedging pro-
blem with B&S Delta we should sell the option at a higher pri e and invest a
higher amount in the underlying to hedge the position. This agrees with the
all pri e in a mixed jump diusion framework and we would take its rst
derivative as the delta to arry out the hedging strategy.
To on lude we report the graphs in gures 4, 5 and 6 with the intention
to oer the possibility of a thorough omprehension on how the dierent
omponents playing a entral role in our analysis behaves with respe t to
ea h other. For a sample of 3 simulated paths we ompare the evolution of
jumps o urren e, underlying, delta, all pri e and error from delta hedging
strategy. It is possible to highlight the response of asset pri e and delta to
jumps and as a result of that the movements in option value and error in the
overing strategy.

5
Mean Absolute Error
5

4.5

3.5

2.5

2
no hedging single h. monthly h. weekly h. daily h.

Figura 3: Mean Absolute Errors

jumps
10

−10
0 10 20 30 40 50 60 70 80
delta
1

0.5

0
0 10 20 30 40 50 60 70 80
underlying
100

90

80
0 10 20 30 40 50 60 70 80
Call
20

10

0
0 10 20 30 40 50 60 70 80
Error
10

−10
0 10 20 30 40 50 60 70 80
time(days)

Figura 4:

6
jumps
5

−5
0 10 20 30 40 50 60 70 80
delta
1

0.8

0.6
0 10 20 30 40 50 60 70 80
underlying
120

100

80
0 10 20 30 40 50 60 70 80
Call
20

10

0
0 10 20 30 40 50 60 70 80
Error
10

−10
0 10 20 30 40 50 60 70 80
time(days)

Figura 5:

jumps
20

−20
0 10 20 30 40 50 60 70 80
delta
1

0.5

0
0 10 20 30 40 50 60 70 80
underlying
120

100

80
0 10 20 30 40 50 60 70 80
Call
40

20

0
0 10 20 30 40 50 60 70 80
Error
20

−20
0 10 20 30 40 50 60 70 80
time(days)

Figura 6:

Você também pode gostar