0% found this document useful (0 votes)
86 views8 pages

Frahw2 PDF

This document contains the submission of two students, Tamara Almeghari and Reem Alhajeri, for a financial risk analysis homework assignment with three questions. Question 1 estimates Value at Risk (VaR) for an options portfolio using delta and Monte Carlo simulations. Question 2 calculates 1-day 99% VaR and expected shortfall for a diversified stock portfolio using historical simulation in a spreadsheet. Question 3 involves simulating a bivariate t-distribution and comparing Pearson correlation and Kendall's tau as estimators of the true correlation. Based on lower variance and mean squared error, Kendall's tau is preferred.

Uploaded by

Tamara Anwar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
86 views8 pages

Frahw2 PDF

This document contains the submission of two students, Tamara Almeghari and Reem Alhajeri, for a financial risk analysis homework assignment with three questions. Question 1 estimates Value at Risk (VaR) for an options portfolio using delta and Monte Carlo simulations. Question 2 calculates 1-day 99% VaR and expected shortfall for a diversified stock portfolio using historical simulation in a spreadsheet. Question 3 involves simulating a bivariate t-distribution and comparing Pearson correlation and Kendall's tau as estimators of the true correlation. Based on lower variance and mean squared error, Kendall's tau is preferred.

Uploaded by

Tamara Anwar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Financial Risk Analysis

HW2
Submitted by :

• Tamara Almeghari 100053921


• Reem Alhajeri 100053056

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;

% Generate random draws from normal distribution


z = randn(N, 1);

% Compute percentage changes in asset price


dx = exp(sigma*sqrt(T)*z) - 1;

% Compute changes in portfolio value


dV = delta*S*dx + 0.5*gamma*(S^2)*(dx.^2);

% Sort changes in portfolio value


dV_sorted = sort(dV);

% Compute 1-day 95% VaR


var_95 = -dV_sorted(ceil(0.05*N))

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;

%import the excel file as a numeric matrix and save it as VaR1


D=VaR1(3:503,4);
F=VaR1(3:503,8);
C=VaR1(3:503,12);
N=VaR1(3:503,16);

D2=zeros(500,1);
F2=zeros(500,1);
C2=zeros(500,1);
N2=zeros(500,1);

for i=2:501

D2(i-1)= D(501)*( D(i)/D(i-1) );

end
for i=2:501

F2(i-1)= F(501) * ( F(i)/F(i-1) );

end
for i=2:501

C2(i-1)= C(501) * ( C(i)/C(i-1) );


end
for i=2:501

N2(i-1)= N(501) * ( N(i)/N(i-1) );

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

SG=[D2 F2 C2 N2 Portfolio_value Loss];

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:

99% one-day VaR


Question3:
a) Write a function that simulates n samples of a bivariate t distribution with 𝜈
degrees- of-freedom, mean vector 𝜇 and correlation 𝜌 and then calculate
estimates of 𝜌 using (i) the usual Pearson correlation coefficient and (ii) Kendall’s
𝜏.

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

% calculate Pearson correlation coefficient & Kendall


rho_perason= corr(R(:,1), R(:,2), 'type', 'Pearson');
rho_kendall=corr(R(:,1), R(:,2), 'type', 'Kendall');
end
b) Write another function that calls your function from part (a) 2000 times with n =
60, 𝜌 = 0.5 and 𝜇 = 0, and then create two plots corresponding to the estimates
produced by methods (i) and (ii) respectively. What estimator do you prefer?

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

% Calculate mean squared error of each estimator


MSE_Pearson = mean((rp - rho).^2)
MSE_Kendall = mean((rk - rho).^2)
Output:
Comment

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.

You might also like