I'm learning generalized Pareto distribution for fitting extreme value data. I came across an R
package evir that is able to plot residuals. Residuals from a GPD would also follow an exponential distribution. GPD pdf for a random variable $y$ is given as.
$y = f(y|u,\xi,\beta) = \frac{1}{\beta}(1+\xi\frac{y-u}{\beta})^{{}-1-\frac{1}{\xi}}$
where $u$ is the threshold, $\xi$ is the shape parameter and $\beta$ is scale parameter, and $\xi \ne 0$ and $\beta >0$.
I'm not able to follow how the residuals are calculated for GPD.
My question is how to calculate residuals from a fitted GPD?
Here is a reproducible example:
## load the evir package
library(evir)
## Data danish for illustration
data(danish)
## Estimate parameters xi and beta, u = 10
fitmodel <- gpd(data = danish,threshold = 10)
## Paremters xi and beta
##$par.ests
##xi beta
##0.4968062 6.9745523
## Plot residuals and QQ plot for residuals
plot(fitmodel)
##Output
#Make a plot selection (or 0 to exit):
#1: plot: Excess Distribution
#2: plot: Tail of Underlying Distribution
#3: plot: Scatterplot of Residuals
#4: plot: QQplot of Residuals
#Selection: 3
#Selection: 4
Here are the plots of residuals (selection:3) and also QQ plot (Selection:4).
plot.gpd
) to see how the residuals are obtained. $\endgroup$