Am I missing something? Currently implementing a VaR and CVaR measure assuming normality of wealth value. after executing the following script, VaR is always greater than CVaR, as expected, but convexity does not match. I would expect VaR and CVaR to be a convex function of a.
clear all x=2.05798*randn(500000,1)+100; varr=zeros(100,1); cvar=zeros(100,1); cv=zeros(100,1); for i=1:100 varr(i,1)=prctile(x,0.01*i); cvar(i,1)=mean(x(x<prctile(x,0.01*i))); cv(1,i)=0.01*i; end hold on plot(varr,'r') hold on plot(cvar) legend('Var','CVar')