Frahw2 PDF
Frahw2 PDF
HW2
Submitted by :
Question1:
• Consider a portfolio of options on a single asset. Suppose that the delta of the portfolio is
12, the value of the asset is $10, and the daily volatility of the asset is 2%.
• Estimate the 1-day 95% VaR for the portfolio from the delta.
• Suppose next that the gamma of the portfolio is -2.6. Derive a quadratic relationship
between the change in the portfolio value and the percentage change in the underlying
asset price in one day. Use this relationship and Monte Carlo simulations to estimate the 1-
day 95% VaR.
% Set up parameters
delta = 12;
gamma = -2.6;
sigma = 0.02;
S = 10;
T = 1;
N = 10000;
Output:
Question2:
• Suppose that the portfolio has (in $000s) 3,000 in DJIA, 3,000 in FTSE, 1,000 in CAC40, and
3,000 in Nikkei 225.
• Use the spreadsheet VaR.xls to calculate one-day 99% VaR and ES using historical simulation
approach.
MATLAB code
clc;
D2=zeros(500,1);
F2=zeros(500,1);
C2=zeros(500,1);
N2=zeros(500,1);
for i=2:501
end
for i=2:501
end
for i=2:501
end
%%
Portfolio_value=zeros(500,1);
Loss=zeros(500,1);
for i=2:501
Portfolio_value(i-1)=10000*(0.3*((D(i)-D(i-1))/D(i-1)) + 0.3*((F(i)-F(i-
1))/F(i-1)) + 0.1*((C(i)-C(i-1))/C(i-1)) + 0.3*((N(i)-N(i-1))/N(i-1))) + 10000;
Loss(i-1)= 10000 - Portfolio_value(i-1);
end
Sort_Loss=sort(Loss,'descend');
One_dayVaR=Sort_Loss(5)
Expected_shortfall=
(Sort_Loss(1)+Sort_Loss(2)+Sort_Loss(3)+Sort_Loss(4)+Sort_Loss(5))/5
Output:
%Part a
function [rho_perason,rho_kendall]=BVT(rho,v,n,mu)
% Generate n samples from bivariate t distribution
R= mvtrnd([1 rho; rho 1],v,n);
R = bsxfun(@plus, R, mu);
%Part b
reps=2000;
rp=zeros(reps,1);
rk=zeros(reps,1);
rho= 0.5;
v= 3;
n=60;
mu=0;
for i=1:reps
[rho_pearson,rho_kendall]=BVT(rho,v,n,mu);
rp(i)=rho_pearson;
rk(i)=rho_kendall;
end
%create plots
figure
subplot(1, 2, 1)
plot(1:reps,rp,'x')
ylabel('Pearson Correlation')
subplot(1, 2, 2)
plot(1:reps,rk,'x')
ylabel('Kendalls Tau')
figure
histogram(rp, 'Normalization', 'pdf');
xlabel('Pearson correlation coefficient');
ylabel('Density');
figure
histogram(rk, 'Normalization', 'pdf');
xlabel('Kendall''s tau');
ylabel('Density');
mean_rhoPearson=mean(rp)
mean_Kendall=mean(rk)
variance_rhoPearson=var(rp)
variance_Kendall=var(rk)
Based on the output, we would prefer Kendall’s tau as an estimator for rho
because it appears to have lower variance and lower MSE compared to the
Pearson correlation coefficient.