% PLOTAPDES.M % PLOTAPDES.M plots the 2D-graphs corresponding to the expected shortfall % of an APD r.v. with parameters alpha and lda. % % Comments: % a standard alpha-quantile r.v. X has pdf : % p(alpha,lda,x) = [A^(1/lda)/gamma(1+1/lda)]*... % *exp[-(A/alpha^lda)*abs(x)^lda], if x <= 0, % *exp[-(A/(1-alpha)^lda)*abs(x)^lda], if x > 0, % where A = (2*alpha^lda*(1-alpha)^lda)/(alpha^lda+(1-alpha)^lda). % % References: % [1] Komunjer, I. (2006): "Asymmetric Power Distribution: Theory and % Applications to Risk Measurement" % % Author: Ivana Komunjer - UCSD (komunjer@ucsd.edu) % Version: 2.1 Date: 06/07/2006 % Inputs the values of alpha and lda pp = (0.005:0.005:0.995)'; aa1 = 0.1*ones(199,1); aa2 = 0.2*ones(199,1); aa3 = 0.3*ones(199,1); aa5 = 0.5*ones(199,1); ll7 = 0.7*ones(199,1); ll1 = 1*ones(199,1); ll2 = 2*ones(199,1); ll4 = 4*ones(199,1); % ES with lda = 0.7 y71 = AlphaQuantES(pp,aa1,ll7); y72 = AlphaQuantES(pp,aa2,ll7); y73 = AlphaQuantES(pp,aa3,ll7); y75 = AlphaQuantES(pp,aa5,ll7); % ES with lda = 1 y11 = AlphaQuantES(pp,aa1,ll1); y12 = AlphaQuantES(pp,aa2,ll1); y13 = AlphaQuantES(pp,aa3,ll1); y15 = AlphaQuantES(pp,aa5,ll1); % ES with lda = 2 y21 = AlphaQuantES(pp,aa1,ll2); y22 = AlphaQuantES(pp,aa2,ll2); y23 = AlphaQuantES(pp,aa3,ll2); y25 = AlphaQuantES(pp,aa5,ll2); % ES with lda = 4 y41 = AlphaQuantES(pp,aa1,ll4); y42 = AlphaQuantES(pp,aa2,ll4); y43 = AlphaQuantES(pp,aa3,ll4); y45 = AlphaQuantES(pp,aa5,ll4); % Generates first graph subplot(2,2,1) plot(pp,y41,'b:',pp,y21,'g-',pp,y11,'m-.',pp,y71,'r--'); axis([0 1 0 5]) title('Alpha = .1'); subplot(2,2,2) plot(pp,y42,'b:',pp,y22,'g-',pp,y12,'m-.',pp,y72,'r--'); axis([0 1 0 5]) title('Alpha = .2'); subplot(2,2,3) plot(pp,y43,'b:',pp,y23,'g-',pp,y13,'m-.',pp,y73,'r--'); axis([0 1 0 5]) title('Alpha = .3'); subplot(2,2,4) plot(pp,y45,'b:',pp,y25,'g-',pp,y15,'m-.',pp,y75,'r--'); axis([0 1 0 5]) title('Alpha = .5'); legend('lambda = 4','lambda = 2', 'lambda = 1', 'lambda = .7'); % Generates second graph subplot(2,2,1) plot(pp,y41,'b:',pp,y21,'g-',pp,y11,'m-.',pp,y71,'r--'); axis([0 1 0 5]) title('Alpha = .1'); subplot(2,2,2) plot(pp,y42,'b:',pp,y22,'g-',pp,y12,'m-.',pp,y72,'r--'); axis([0 1 0 5]) title('Alpha = .2'); subplot(2,2,3) plot(pp,y43,'b:',pp,y23,'g-',pp,y13,'m-.',pp,y73,'r--'); axis([0 1 0 5]) title('Alpha = .3'); subplot(2,2,4) plot(pp,y45,'b:',pp,y25,'g-',pp,y15,'m-.',pp,y75,'r--'); axis([0 1 0 5]) title('Alpha = .5'); legend('lambda = 4','lambda = 2', 'lambda = 1', 'lambda = .7'); subplot(2,2,1) plot(pp,y71,'b:',pp,y72,'g-',pp,y73,'m-.',pp,y75,'r--'); axis([0 1 0 5]) title('Lambda = .7'); subplot(2,2,2) plot(pp,y11,'b:',pp,y12,'g-',pp,y13,'m-.',pp,y15,'r--'); axis([0 1 0 5]) title('Lambda = 1'); subplot(2,2,3) plot(pp,y21,'b:',pp,y22,'g-',pp,y23,'m-.',pp,y25,'r--'); title('Lambda = 2'); subplot(2,2,4) plot(pp,y41,'b:',pp,y42,'g-',pp,y43,'m-.',pp,y45,'r--'); axis([0 1 0 5]) title('Lambda = 4'); legend('alpha = .1','alpha = .2', 'alpha = .3', 'alpha = .5');