# Exercise 2.21, page 46 in McNeil et al (2005)
alpha <- c(.90, .95, .975, .99, .995)
(ES(variance=(0.2/sqrt(250))^2, alpha=alpha, model='normal'))*10000
(ES(variance=(0.2/sqrt(250))^2, alpha=alpha, model='t-student', df=4))*10000
# Both type of models at once.
(ES(variance=(0.2/sqrt(250))^2, alpha=alpha, model='both', df=4))*10000
# A vector of losses
variance <- matrix(c(100,150,150,900), 2) # covariance matrix
w <- c(0.5, 0.5) # a vector weights
ES(variance=variance, weights=w, alpha=0.95)
Run the code above in your browser using DataLab