FIN285a: Problem Set 5



FIN285a: Problem Set 5

Fall 2004

Due Wednesday, October 27th

1. For this problem I would like you to load the dow.dat data set using the loaddow.m matlab program. Then use arithmetic returns along with a portfolio with a starting value of 100 in the following problems.

1. Plot the VaR for all confidence levels from 99 through 90 incrementing by 1. Do this for both the historical data, and for a normal distribution with mean and std set equal to the data. Use "hold on" to put your plot lines on the same graph. If you want to get fancy try a different color or different styled line with a legend. The second case will require a monte-carlo analysis since you probably can't find tables with values from 99 to 90. Do this with a single draw of 1,000,000 normal returns with mean and std equal to the Dow sample.

Program:

%h5_1

load dow.dat

% dow: 28095 by 3 matrix, with Matlab date in first column, DJ index level in

% second and volume in third column

% p: Second column from the dow

p = dow(:,2);

% ret1: arithmetic returns based on DJ level

% pdate: Corresponding datea of the DJ index level

ret1 = (p(2:end)-p(1:end-1))./p(1:end-1);

pdate = dow(:,1)/365.25;

ret1(5257) = 0;

x = 100; % starting value of the portfolio

one_day = x*(1+ret1); %portfolio value after one day, given returns in ret1

cl = 0.1:-0.01:0.01; % significance levels

m = mean(ret1)

varret = var(ret1)

ret1_sim = normal(1000000,m,varret); % simulated returns

one_day_sim = x*(1+ret1_sim);

for i = 1:length(cl)

hist_var(i) = x-percentile(one_day,cl(i)); % historical var

norm_var(i) = x - percentile(one_day_sim,cl(i));

end

plot(90:99,hist_var,'*-')

hold on

plot(90:99,norm_var,'-')

title('Series of one-day Historical and normal VaR, 90:99% confidence level')

xlabel('confidence level, in %')

ylabel('VaR')

legend('historical VaR', 'normal VaR')

grid on

Results:

m = 2.6099e-004

varret = 1.1460e-004

[pic]

2. Repeat this figure for the ETL.

Program:

%h5_1

load dow.dat

% dow: 28095 by 3 matrix, with Matlab date in first column, DJ index level in

% second and volume in third column

% p: Second column from the dow

p = dow(:,2);

% ret1: arithmetic returns based on DJ level

% pdate: Corresponding datea of the DJ index level

ret1 = (p(2:end)-p(1:end-1))./p(1:end-1);

pdate = dow(:,1)/365.25;

ret1(5257) = 0;

x = 100; % starting value of the portfolio

one_day = x*(1+ret1); %portfolio value after one day, given returns in ret1

cl = 0.1:-0.01:0.01; % significance levels

m = mean(ret1)

varret = var(ret1)

ret1_sim = normal(1000000,m,varret); % simulated returns

one_day_sim = x*(1+ret1_sim);

for i = 1:length(cl)

val(i) = percentile(one_day,cl(i)); % value of cl percentile

hist_etl(i) = x-mean(one_day(one_day ................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download