Learn R Programming

QRM (version 0.4-31)

ES: Expected Shortfall

Description

Functions for computing the expected shortfall derived from the Normal or Student's t distribution (see page 45 of QRM).

Usage

ESnorm(p, mu = 0, sd = 1)
ESst(p, mu = 0, sd = 1, df, scale = FALSE)

Arguments

p

numeric, probability

mu

numeric, location parameter

sd

numeric, scale parameter

df

numeric, degrees of freedom

scale

logical, scaling Student's t distribution to have variance one

Value

numeric

Examples

Run this code
# NOT RUN {
p <- c(0.95, 0.99)
s <- 0.2 * 10000 / sqrt(250)
ESnorm(p)
ESst(p, sd = s, df = 4, scale = TRUE)
ESst(p, df = 4)
# }

Run the code above in your browser using DataLab