Skip to contents

The function tstab.egp provides classical threshold stability plot for (\(\kappa\), \(\sigma\), \(\xi\)). The fitted parameter values are displayed with pointwise normal 95% confidence intervals. The function returns an invisible list with parameter estimates and standard errors, and p-values for the Wald test that \(\kappa=1\). The plot is for the modified scale (as in the generalised Pareto model) and as such it is possible that the modified scale be negative. tstab.egp can also be used to fit the model to multiple thresholds.

Usage

fit.egp(
  xdat,
  thresh = 0,
  model = c("pt-beta", "pt-gamma", "pt-power", "gj-tnorm", "gj-beta", "exptilt",
    "logist"),
  start = NULL,
  method = c("Nelder", "nlminb", "BFGS"),
  fpar = NULL,
  show = FALSE,
  ...
)

Arguments

xdat

vector of observations, greater than the threshold

thresh

threshold value

model

a string indicating which extended family to fit

start

optional named list of initial values, with \(\kappa\), \(sigma\) or \(xi\).

method

the method to be used. See Details. Can be abbreviated.

fpar

a named list with fixed parameters, either scale or shape

show

logical; if TRUE, print the results of the optimization

...

additional parameters, for backward compatibility purposes

Value

fit.egp outputs the list returned by optim, which contains the parameter values, the hessian and in addition the standard errors

tstab.egp returns a plot(s) of the parameters fit over the range of provided thresholds, with pointwise normal confidence intervals; the function also returns an invisible list containing notably the matrix of point estimates (par) and standard errors (se).

Details

fit.egp is a numerical optimization routine to fit the extended generalised Pareto models of Papastathopoulos and Tawn (2013), using maximum likelihood estimation.

References

Papastathopoulos, I. and J. Tawn (2013). Extended generalised Pareto models for tail estimation, Journal of Statistical Planning and Inference 143(3), 131–143.

Author

Leo Belzile

Examples

xdat <- mev::rgp(
  n = 100,
  loc = 0,
  scale = 1,
  shape = 0.5)
fitted <- fit.egp(
  xdat = xdat,
  thresh = 1,
  model = "pt-gamma",
  show = TRUE)
#> Model: Papastathopoulos-Tawn's EGP 2 
#> Deviance: 184.419 
#> 
#> Threshold: 1 
#> Number Above: 42 
#> Proportion Above: 0.42 
#> 
#> Estimates
#> kappa  scale  shape  
#> 1.311  0.777  0.914  
#> 
#> Standard Errors
#> kappa  scale  shape  
#> 0.645  0.894  0.266  
#> 
#> Optimization Information
#>   Convergence: successful 
#>   Function Evaluations: 122 
#>   Gradient Evaluations: NA 
#> 
thresh <- mev::qgp(seq(0.1, 0.5, by = 0.05), 0, 1, 0.5)
tstab.egp(
   xdat = xdat,
   thresh = thresh,
   model = "pt-gamma",
   plots = 1:3)
#> Warning: Modified scale not available for EGPD models.
#> Warning: NaNs produced

xdat <- regp(
  n = 100,
  scale = 1,
  shape = 0.1,
  kappa = 0.5,
  model = "pt-power"
)
fit.egp(
 xdat = xdat,
 model = "pt-power",
 show = TRUE,
 fpar = list(kappa = 1),
 method = "Nelder"
)
#> Model: Papastathopoulos-Tawn's EGP 3 (power) 
#> Deviance: 149.32 
#> 
#> Threshold: 0 
#> Number Above: 100 
#> Proportion Above: 1 
#> 
#> Estimates
#> scale  shape  
#> 0.591  0.273  
#> 
#> Standard Errors
#> scale  shape  
#> 0.108  0.155  
#> 
#> Optimization Information
#>   Convergence: successful 
#>   Function Evaluations: 39 
#>   Gradient Evaluations: NA 
#>