Description Usage Arguments Value Examples
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.
1 | asymptoticCIforGPDfit(fitGPD, h, hGrad, alpha = 0.05, verbose = TRUE)
|
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 |
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 |
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 )
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.