asymptoticCIforGPDfit: Build (1-alpha) confidence intervals of functions of GPD...

Description Usage Arguments Value Examples

View source: R/GPD.R

Description

This function applies the delta method to derive a (1-alpha) confidence interval of the function h(xi, beta) where xi, and beta are respectively the MLE estimators of the shape and scale parameters of a GPD distribution.

Usage

1
asymptoticCIforGPDfit(fitGPD, h, hGrad, alpha = 0.05, verbose = TRUE)

Arguments

fitGPD

An object obtained using the function fit.GPD available in the package QRM available on CRAN

h

A function taking for argument the shape xi, and scale beta parameters of a GPD distribution

hGrad

The gradient of the function h w.r.t to xi, and beta, in that order

alpha

The desired level of accuracy for the confidence interval

verbose

A logical value indicating wether messages should be printed on the screen

Value

a data frame containing three values

lB

the lower bound of the confidence interval

hHat

the estimated value of h(xi,beta)

uB

the upper bound of the confidence interval

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
library(QRM)
sample <- rGPD(500, 1,1)

# Find a suitable threshold, and fit a GPD
MEplot(sample)
u <- 0
fitGPD <- fit.GPD(sample, u, type = "ml")

# Build a CI on P(4 <= X <= 9), whose true value is 10%
h <- function(xi, beta) pGPD(9 -u,xi,beta) - pGPD(4 -u,xi,beta)
hGrad <- function(xi,beta) gradientpGPD(9-u,xi,beta) - gradientpGPD(4-u,xi,beta)
asymptoticCIforGPDfit(fitGPD,h,hGrad )

cmottet/DistributionPty documentation built on May 13, 2019, 8:44 p.m.