close all
clear all

    
[DATASET LABELS]=xlsread('File_excel.xlsx','Time Series','B2:K27')

ANN_RET=mean(DATASET)


figure(1)
barh(ANN_RET)
title('Average Annual Returns')
ylabel('Markets')
xlabel('Average Returns')
set(gca,'YTickLabel',LABELS)
grid on


 
WEIGHTS=xlsread('File_excel','Time Series','B30:K30')

figure(2)
pie(WEIGHTS)
title('Portfoglio Weights')
LEGEND=legend(LABELS,'Location','SouthOutside')


AV_RET_PORT=WEIGHTS*ANN_RET'


figure(3)
plot(DATASET(:,1))
hold on
plot(DATASET(:,4),'r')
hold on
plot(DATASET(:,6),'g')
hold on
plot(DATASET(:,7),'y')
hold off
grid on
title('Volatility')
ylabel('Annual return')
xlabel('Time')
LEGEND= legend([LABELS(1,1) LABELS(1,4) LABELS(1,6) LABELS(1,7)],'Location','SouthOutside')


SIGMA=std(DATASET)

figure(4)
subplot(1,2,1)
barh(SIGMA,'r')
title('Standard Deviations')
ylabel('Markets')
xlabel('Standard Deviations')
set(gca,'YTickLabel',LABELS)
grid on
subplot(1,2,2)
scatter(SIGMA,ANN_RET,'filled')
title('Risk-Return')
ylabel('Av Ret')
xlabel('Standard Deviation')
grid on


figure(5)
subplot(2,2,1)
scatter(DATASET(:,7),DATASET(:,8))
title('Corr MSCI Europe - MSCI NA')
ylabel('MSCI North America')
xlabel('Msci Europe')
grid on
lsline

subplot(2,2,2)
scatter(DATASET(:,7),DATASET(:,10))
title('Corr MSCI Europe - MSCI EM')
ylabel('MSCI EM')
xlabel('Msci Europe')
grid on
lsline

subplot(2,2,3)
scatter(DATASET(:,7),DATASET(:,5))
title('Corr MSCI Europe - Global HY Corp')
ylabel('Global HY Corp')
xlabel('Msci Europe')
grid on
lsline

subplot(2,2,4)
scatter(DATASET(:,7),DATASET(:,3))
title('Corr MSCI Europe - Bond Area €')
ylabel('Bond € Area')
xlabel('Msci Europe')
grid on
lsline


CORRELATIONS=corr(DATASET)
COVARIANCES=cov(DATASET)



SIGMA_PORT=sqrt(WEIGHTS*COVARIANCES*WEIGHTS')


K1=norminv([0.95])
K2=norminv([0.99])


VAR_95=ANN_RET-K1.*SIGMA
VAR_99=ANN_RET-K2.*SIGMA


AGGR_VAR=[VAR_95' VAR_99']

figure(6)
barh([AGGR_VAR])
title('VaR (conf lev=95% & 99%)')
ylabel('Mkts')
xlabel('VaR')
set(gca,'YTickLabel',LABELS)
legenda= legend({'VaR 95%', 'VaR 99%'},'Location','SouthOutside')
grid on





%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%THE END
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
