if (FALSE) {
# generate data
set.seed(1234)
n <- 500
samp <- evd::rfrechet(n, 0, 3, 4)
# set effective sample size and threshold
k <- 50
threshold <- sort(samp, decreasing = TRUE)[k+1]
# preliminary mle estimates of scale and shape parameters
mlest <- evd::fpot(samp, threshold)
# empirical bayes procedure
proc <- estPOT(
samp,
k = k,
pn = c(0.01, 0.005),
type = "continuous",
method = "bayesian",
prior = "empirical",
start = as.list(mlest$estimate),
sig0 = 0.1)
plotBayes(
proc$post_sample[,1],
mlest$estimate,
param = "scale")
plotBayes(
proc$post_sample[,2],
param = "shape")
}
Run the code above in your browser using DataLab