| extBQuant | R Documentation |
Given posterior samples for the parameters of the continuous or discrete generalized Pareto distribution,
return the posterior mean and 1-\alpha level credibility intervals of the extreme quantile
extBQuant(
threshold,
postsamp,
k,
n,
retp,
alpha = 0.05,
type = c("continuous", "discrete")
)
threshold |
threshold for the generalized Pareto model, corresponding to the |
postsamp |
a |
k |
integer, number of exceedances for the generalized Pareto (only used if |
n |
integer, number of observations in the full sample. Must be greater than |
retp |
double indicating the value of the return period |
alpha |
level for credibility interval. Default: 0.05 giving 95% credibility intervals |
type |
string indicating distribution types. Default: |
a list with components
mQ posterior mean of the extreme quantile
ciQ vector of dimension 2 returning the \alpha/2 and 1-\alpha/2 empirical quantiles of the posterior distribution of the extreme quantile
## Not run:
# generate data
set.seed(1234)
n <- 500
samp <- evd::rfrechet(500,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)
# extreme quantile corresponding to a return period of 100
extBQuant(
proc$t,proc$post_sample,
k,
n,
100,
0.05,
type = "continuous")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.