Description Usage Arguments Details Value References See Also Examples

Uses the `rust`

package to simulate from the posterior
distribution of the extremal index *θ* based on the K-gaps model
for threshold interexceedance times of Suveges and Davison (2010).

1 2 |

`data` |
A numeric vector of raw data. No missing values are allowed. |

`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 censored inter-exceedance times relating to the first and last observation. See Attalides (2015) for details. |

`alpha, beta` |
Positive numeric scalars. Parameters of a
beta( |

`param` |
A character scalar. If |

`use_rcpp` |
A logical scalar. If |

A beta(*α*, *β*) prior distribution is used for
*θ* so that the posterior from which values are simulated is
proportional to

*θ ^ (2 N_1 + α - 1) * (1 - θ) ^ (N_0 + β - 1) *
exp(- θ q (S_0 + ... + S_N)).*

See `kgaps_stats`

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 *θ* is unbounded as
*θ* approaches 0 or 1, we simulate from the posterior
distribution of *φ = logit(θ)* and then transform back to the
*θ*-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

`model`

: The character scalar`"kgaps"`

.`thresh`

: The argument`thresh`

.`ss`

: The sufficient statistics for the K-gaps likelihood, as calculated by`kgaps_stats`

.

Suveges, M. and Davison, A. C. (2010) Model
misspecification in peaks over threshold analysis, *The Annals of
Applied Statistics*, **4**(1), 203-221.
http://dx.doi.org/10.1214/09-AOAS292

Attalides, N. (2015) Threshold-based extreme value modelling, PhD thesis, University College London. http://discovery.ucl.ac.uk/1471121/1/Nicolas_Attalides_Thesis.pdf

`kgaps_mle`

for maximum likelihood estimation of the
extremal index *θ* using the K-gaps model.

`kgaps_stats`

for the calculation of sufficient
statistics for the K-gaps model.

`ru`

for the form of the object returned by
`kgaps_post`

.

1 2 3 | ```
thresh <- quantile(newlyn, probs = 0.90)
k_postsim <- kgaps_post(newlyn, thresh)
plot(k_postsim)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.