Skip to contents

Fits a generalized Pareto distribution to the draws above their empirical level quantile, so that VaR() and TVaR() at levels above level extend smoothly past the largest draw.

Usage

pot_tail(draws, level)

Arguments

draws

A sampled object.

level

Threshold level, for example 0.95 for the top 5%.

Value

A pot_tail object with threshold, p_exceed, xi and beta properties; VaR() and TVaR() accept levels p >= 1 - p_exceed.

Examples

s <- sampled(qlnorm(ppoints(100000)))
tail <- pot_tail(s, 0.95)
VaR(tail, 0.999) / qlnorm(0.999)
#> [1] 0.9997629
TVaR(tail, c(0.99, 0.999))
#> [1] 15.25231 30.86982