kgaps_post | R Documentation |
Uses the rust
package to simulate from the posterior
distribution of the extremal index \theta
based on the K-gaps model
for threshold interexceedance times of Suveges and Davison (2010).
kgaps_post(
data,
thresh,
k = 1,
n = 1000,
inc_cens = TRUE,
alpha = 1,
beta = 1,
param = c("logit", "theta"),
use_rcpp = TRUE
)
data |
A numeric vector or numeric matrix of raw data. If If |
thresh |
A numeric scalar. Extreme value threshold applied to data. |
k |
A numeric scalar. Run parameter |
n |
A numeric scalar. The size of posterior sample required. |
inc_cens |
A logical scalar indicating whether or not to include
contributions from right-censored inter-exceedance times, relating to the
first and last observations. It is known that these times are greater
than or equal to the time observed.
If |
alpha , beta |
Positive numeric scalars. Parameters of a
beta( |
param |
A character scalar. If |
use_rcpp |
A logical scalar. If |
A beta(\alpha
, \beta
) prior distribution is used for
\theta
so that the posterior from which values are simulated is
proportional to
\theta ^ {2 N_1 + \alpha - 1} (1 - \theta) ^ {N_0 + \beta - 1}
\exp\{- \theta q (S_0 + \cdots + S_N)\}.
See kgaps_stat
for a description of the variables
involved in the contribution of the likelihood to this expression.
The ru
function in the rust
package simulates from this posterior distribution using the
generalised ratio-of-uniforms distribution. To improve the probability
of acceptance, and to ensure that the simulation will work even in
extreme cases where the posterior density of \theta
is unbounded as
\theta
approaches 0 or 1, we simulate from the posterior
distribution of
\phi = \log(\theta / (1-\theta))
and then transform back to the \theta
-scale.
An object (list) of class "evpost"
, which has the same
structure as an object of class "ru"
returned from
ru
.
In addition this list contains
call
: The call to kgaps()
.
model
: The character scalar "kgaps"
.
thresh
: The argument thresh
.
ss
: The sufficient statistics for the K-gaps likelihood,
as calculated by kgaps_stat
.
Suveges, M. and Davison, A. C. (2010) Model misspecification in peaks over threshold analysis, The Annals of Applied Statistics, 4(1), 203-221. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1214/09-AOAS292")}
ru
for the form of the object returned by
kgaps_post
.
dgaps_post
for Bayesian inference about the
extremal index \theta
using the D
-gaps model.
# Newlyn sea surges
thresh <- quantile(newlyn, probs = 0.90)
k_postsim <- kgaps_post(newlyn, thresh)
plot(k_postsim)
### Cheeseboro wind gusts
k_postsim <- kgaps_post(exdex::cheeseboro, thresh = 45, k = 3)
plot(k_postsim)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.