This is a slightly modified versions of the pot function in the evir package. The main modification is to add to the returned object the argument data supplied by the user. This is added to the returned (list) object with the name input_data.

pot_refit(data, threshold = NA, nextremes = NA, run = NA, picture = TRUE, ...)

Arguments

data

numeric vector of data, which may have a times attribute containing (in an object of class "POSIXct", or an object that can be converted to that class; see as.POSIXct) the times/dates of each observation. If no times attribute exists, the data are assumed to be equally spaced.

threshold

a threshold value (either this or nextremes must be given but not both).

nextremes

the number of upper extremes to be used (either this or threshold must be given but not both).

run

if the data are to be declustered the run length parameter for the runs method (see decluster) should be entered here.

picture

whether or not a picture should be drawn if declustering is performed.

...

arguments passed to optim.

References

Bernhard Pfaff and Alexander McNeil (2018). evir: Extreme Values in R. R package version 1.7-4. https://CRAN.R-project.org/package=evir.

Examples

# We need the evir package
got_evir <- requireNamespace("evir", quietly = TRUE)
if (got_evir) {
  library(evir)
  data(danish)
  out <- pot(danish, 10)
  ls(out)
  out <- pot_refit(danish, 10)
  ls(out)
}
#>  [1] "converged"     "data"          "input_data"    "intensity"    
#>  [5] "n"             "n.exceed"      "nllh.final"    "p.less.thresh"
#>  [9] "par.ests"      "par.ses"       "period"        "run"          
#> [13] "span"          "threshold"     "varcov"