Learn R Programming

GenHMM1d (version 0.2.1)

ES: Expected shortfall function

Description

This function computes the expected shortfall of an univariate distribution, excluding zero-inflated.

Usage

ES(p, param, family, size = 0, Nsim = 25000)

Value

es

expected shortfall

Arguments

p

value (1 x 1) at which the expected shortfall needs to be computed; between 0 and 1; (e.g 0.01, 0.05)

param

parameters of the distribution; (1 x p)

family

distribution name; run the function distributions() for help

size

additional parameter for some discrete distributions; run the command distributions() for help

Nsim

number of simulations

Examples

Run this code
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