powered by
This function computes the expected shortfall of an univariate distribution, excluding zero-inflated.
ES(p, param, family, size = 0, Nsim = 25000)
expected shortfall
value (1 x 1) at which the expected shortfall needs to be computed; between 0 and 1; (e.g 0.01, 0.05)
parameters of the distribution; (1 x p)
distribution name; run the function distributions() for help
additional parameter for some discrete distributions; run the command distributions() for help
number of simulations
family = "gaussian" theta = c(-1.5, 1.7) ; es = ES( 0.01, theta, family) print('Expected shortfall : ') print(es$es)
Run the code above in your browser using DataLab